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/models/SimpleORMap.class.php | |
| parent | f8d42374860009922ee68bd9aba63e50f66e77df (diff) | |
adjustments for php8, fixes #4111
Closes #4111
Merge request studip/studip!2956
Diffstat (limited to 'lib/models/SimpleORMap.class.php')
| -rw-r--r-- | lib/models/SimpleORMap.class.php | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/lib/models/SimpleORMap.class.php b/lib/models/SimpleORMap.class.php index 2013db4..f86ec6f 100644 --- a/lib/models/SimpleORMap.class.php +++ b/lib/models/SimpleORMap.class.php @@ -1638,16 +1638,13 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate return false; } } + /** * ArrayAccess: Check whether the given offset exists. * * @param string $offset - * @return bool - * - * @todo Add bool return type when Stud.IP requires PHP8 minimal */ - #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return $this->__isset($offset); } @@ -1659,11 +1656,8 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate * @throws BadMethodCallException if getter for additional field could not be found * @param string $offset the column or additional field * @return null|string|SimpleORMapCollection - * - * @todo Add mixed return type when Stud.IP requires PHP8 minimal */ - #[ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return $this->getValue($offset); } @@ -1675,49 +1669,34 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate * @throws BadMethodCallException if setter for additional field could not be found * @param string $offset * @param mixed $value - * @return void - * - * @todo Add void return type when Stud.IP requires PHP8 minimal */ - #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { $this->setValue($offset, $value); } + /** * ArrayAccess: unset the value at the given offset (not applicable) * * @param string $offset - * @return void - * - * @todo Add void return type when Stud.IP requires PHP8 minimal */ - #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { } + /** * IteratorAggregate - * - * @return ArrayIterator - * - * @todo Add Traversable return type when Stud.IP requires PHP8 minimal */ - #[ReturnTypeWillChange] - public function getIterator() + public function getIterator(): ArrayIterator { return new ArrayIterator($this->toArray()); } + /** * Countable - * - * @return int - * - * @todo Add int return type when Stud.IP requires PHP8 minimal */ - #[ReturnTypeWillChange] - public function count() + public function count(): int { return count($this->known_slots()) - count($this->relations); } |
