diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-05-06 08:50:32 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2024-05-06 08:50:32 +0000 |
| commit | c659d71e33cecbe42a7038c281c082f4b5c98414 (patch) | |
| tree | 6bb722750e822599723045082449d2e63034dd6f /lib/classes/StudipArrayObject.class.php | |
| parent | f8d42374860009922ee68bd9aba63e50f66e77df (diff) | |
adjustments for php8, fixes #4111
Closes #4111
Merge request studip/studip!2956
Diffstat (limited to 'lib/classes/StudipArrayObject.class.php')
| -rw-r--r-- | lib/classes/StudipArrayObject.class.php | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/lib/classes/StudipArrayObject.class.php b/lib/classes/StudipArrayObject.class.php index fe9aad1..531da67 100644 --- a/lib/classes/StudipArrayObject.class.php +++ b/lib/classes/StudipArrayObject.class.php @@ -157,13 +157,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable, /** * Get the number of public properties in the ArrayObject - * - * @return int - * - * @todo Add int return type when Stud.IP requires PHP8 minimal */ - #[ReturnTypeWillChange] - public function count() + public function count(): int { return count($this->storage); } @@ -216,13 +211,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable, /** * Create a new iterator from an ArrayObject instance - * - * @return \Iterator - * - * @todo Add Traversable return type when Stud.IP requires PHP8 minimal */ - #[ReturnTypeWillChange] - public function getIterator() + public function getIterator(): Traversable { $class = $this->iteratorClass; @@ -273,12 +263,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable, * Returns whether the requested key exists * * @param mixed $key - * @return bool - * - * @todo Add void return type when Stud.IP requires PHP8 minimal */ - #[ReturnTypeWillChange] - public function offsetExists($key) + public function offsetExists($key): bool { return isset($this->storage[$key]); } @@ -287,12 +273,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable, * Returns the value at the specified key * * @param mixed $key - * @return mixed - * - * @todo Add mixed return type when Stud.IP requires PHP8 minimal */ - #[ReturnTypeWillChange] - public function offsetGet($key) + public function offsetGet($key): mixed { $ret = null; if (!$this->offsetExists($key)) { @@ -308,12 +290,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable, * * @param mixed $key * @param mixed $value - * @return void - * - * @todo Add void return type when Stud.IP requires PHP8 minimal */ - #[ReturnTypeWillChange] - public function offsetSet($key, $value) + public function offsetSet($key, $value): void { if (is_null($key)) { $this->append($value); @@ -326,12 +304,8 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable, * Unsets the value at the specified key * * @param mixed $key - * @return void - * - * @todo Add void return type when Stud.IP requires PHP8 minimal */ - #[ReturnTypeWillChange] - public function offsetUnset($key) + public function offsetUnset($key): void { if ($this->offsetExists($key)) { unset($this->storage[$key]); |
