Skip to content

Commit f39a633

Browse files
committed
SessionSection: removed $warnOnUndefined (BC break)
1 parent 55ea994 commit f39a633

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

src/Http/SessionSection.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
*/
1818
class SessionSection implements \IteratorAggregate, \ArrayAccess
1919
{
20-
/** Emits a warning when accessing an undefined variable in this section */
21-
public bool $warnOnUndefined = false;
22-
23-
2420
/**
2521
* Do not call directly. Use Session::getSection().
2622
*/
@@ -115,12 +111,7 @@ public function &__get(string $name): mixed
115111
trigger_error("Reading from \$session->$name is deprecated, use \$session->get('$name') instead", E_USER_DEPRECATED);
116112
$this->session->autoStart(forWrite: true);
117113
$data = &$this->getData();
118-
$data ??= [];
119-
if ($this->warnOnUndefined && !array_key_exists($name, $data)) {
120-
trigger_error("The variable '$name' does not exist in session section");
121-
}
122-
123-
return $data[$name];
114+
$data ??= []; return $data[$name];
124115
}
125116

126117

0 commit comments

Comments
 (0)