Skip to content

Commit 08f5afb

Browse files
Internal: Update session.class.php PHP 8 compatibility by adding typed return values
1 parent 5e9f2f0 commit 08f5afb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

main/inc/lib/system/session.class.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ public static function destroy()
120120
}
121121

122122
/*
123-
* ArrayAccess
123+
* ArrayAccess : bool
124124
*/
125-
public function offsetExists($offset)
125+
public function offsetExists($offset): bool
126126
{
127127
return isset($_SESSION[$offset]);
128128
}
@@ -133,19 +133,19 @@ public function offsetExists($offset)
133133
*
134134
* @param string $offset
135135
*
136-
* @return mixed
136+
* @return mixed (write offsetGet($offset): mixed on PHP 8 and & > )
137137
*/
138138
public function offsetGet($offset)
139139
{
140140
return self::read($offset);
141141
}
142142

143-
public function offsetSet($offset, $value)
143+
public function offsetSet($offset, $value): void
144144
{
145145
self::write($offset, $value);
146146
}
147147

148-
public function offsetUnset($offset)
148+
public function offsetUnset($offset): void
149149
{
150150
unset($_SESSION[$offset]);
151151
}

0 commit comments

Comments
 (0)