aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/SessionDecoder.class.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2023-03-10 18:45:14 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2023-03-10 18:45:14 +0000
commit01ebc410441ae59c684381c175217281c2d78edd (patch)
tree75ae7153be87bfc53861abe13cee4ad9f2eab703 /lib/classes/SessionDecoder.class.php
parentfef7d9367736f3b33b0318da237ab024841c4f3f (diff)
return type adjustments, fixes #2290
Closes #2290 Merge request studip/studip!1514
Diffstat (limited to 'lib/classes/SessionDecoder.class.php')
-rw-r--r--lib/classes/SessionDecoder.class.php82
1 files changed, 68 insertions, 14 deletions
diff --git a/lib/classes/SessionDecoder.class.php b/lib/classes/SessionDecoder.class.php
index c6715cd..8c0bc6b 100644
--- a/lib/classes/SessionDecoder.class.php
+++ b/lib/classes/SessionDecoder.class.php
@@ -83,44 +83,98 @@ class SessionDecoder implements ArrayAccess, Countable, Iterator {
return $this->var_names;
}
- public function rewind() {
+ /**
+ * @todo Add void return type when Stud.IP requires PHP8 minimal
+ */
+ #[ReturnTypeWillChange]
+ public function rewind()
+ {
reset($this->var_names);
}
- public function current() {
+ /**
+ * @todo Add mixed return type when Stud.IP requires PHP8 minimal
+ */
+ #[ReturnTypeWillChange]
+ public function current()
+ {
$current = current($this->var_names);
return $current !== false ? $this->offsetGet($current) : false;
}
- public function key() {
+ /**
+ * @todo Add mixed return type when Stud.IP requires PHP8 minimal
+ */
+ #[ReturnTypeWillChange]
+ public function key()
+ {
return current($this->var_names);
}
- public function next() {
- $next = next($this->var_names);
- return $this->current();
+ /**
+ * @todo Add void return type when Stud.IP requires PHP8 minimal
+ */
+ #[ReturnTypeWillChange]
+ public function next()
+ {
+ next($this->var_names);
}
- public function valid() {
+ /**
+ * @todo Add bool return type when Stud.IP requires PHP8 minimal
+ */
+ #[ReturnTypeWillChange]
+ public function valid()
+ {
$current = current($this->var_names);
return $current !== false;
}
- public function offsetExists($offset){
+ /**
+ * @todo Add bool return type when Stud.IP requires PHP8 minimal
+ */
+ #[ReturnTypeWillChange]
+ public function offsetExists($offset)
+ {
return isset($this->encoded_session[$offset]);
}
- public function offsetGet($offset){
- if($this->offsetExists($offset) && !isset($this->decoded_session[$offset])){
+ /**
+ * @param $offset
+ * @return mixed|null
+ * @todo Add mixed return type when Stud.IP requires PHP8 minimal
+ */
+ #[ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ if($this->offsetExists($offset) && !isset($this->decoded_session[$offset])) {
$this->decoded_session[$offset] = unserialize($this->encoded_session[$offset]);
}
- return isset($this->decoded_session[$offset]) ? $this->decoded_session[$offset] : null;
+ return $this->decoded_session[$offset] ?? null;
}
- public function offsetSet($offset, $value) {}
- public function offsetUnset($offset) {}
+ /**
+ * @todo Add void return type when Stud.IP requires PHP8 minimal
+ */
+ #[ReturnTypeWillChange]
+ public function offsetSet($offset, $value)
+ {
+ }
- public function count(){
+ /**
+ * @todo Add void return type when Stud.IP requires PHP8 minimal
+ */
+ #[ReturnTypeWillChange]
+ public function offsetUnset($offset)
+ {
+ }
+
+ /**
+ * @todo Add int return type when Stud.IP requires PHP8 minimal
+ */
+ #[ReturnTypeWillChange]
+ public function count()
+ {
return count($this->var_names);
}