Internal: Update session.class.php PHP 8 compatibility by adding typed return values

pull/5867/head
DamienLyon 11 months ago committed by GitHub
parent 5e9f2f0b6c
commit 08f5afb4dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      main/inc/lib/system/session.class.php

@ -120,9 +120,9 @@ class Session implements \ArrayAccess
} }
/* /*
* ArrayAccess * ArrayAccess : bool
*/ */
public function offsetExists($offset) public function offsetExists($offset): bool
{ {
return isset($_SESSION[$offset]); return isset($_SESSION[$offset]);
} }
@ -133,19 +133,19 @@ class Session implements \ArrayAccess
* *
* @param string $offset * @param string $offset
* *
* @return mixed * @return mixed (write offsetGet($offset): mixed on PHP 8 and & > )
*/ */
public function offsetGet($offset) public function offsetGet($offset)
{ {
return self::read($offset); return self::read($offset);
} }
public function offsetSet($offset, $value) public function offsetSet($offset, $value): void
{ {
self::write($offset, $value); self::write($offset, $value);
} }
public function offsetUnset($offset) public function offsetUnset($offset): void
{ {
unset($_SESSION[$offset]); unset($_SESSION[$offset]);
} }

Loading…
Cancel
Save