diff --git a/src/Contao/SessionStorage.php b/src/Contao/SessionStorage.php index 4c7c9630..59807783 100644 --- a/src/Contao/SessionStorage.php +++ b/src/Contao/SessionStorage.php @@ -134,6 +134,7 @@ public function set($name, $value) $this->load(); $this->attributes[$name] = $value; $this->persist(); + return $this; } @@ -143,6 +144,7 @@ public function set($name, $value) public function all() { $this->load(); + return $this->attributes; } @@ -154,6 +156,7 @@ public function replace(array $attributes) $this->load(); $this->attributes = \array_merge($this->attributes, $attributes); $this->persist(); + return $this; } @@ -165,6 +168,7 @@ public function remove($name) $this->load(); unset($this->attributes[$name]); $this->persist(); + return $this; } @@ -176,6 +180,7 @@ public function clear() $this->load(); $this->attributes = []; $this->persist(); + return $this; } @@ -184,7 +189,7 @@ public function clear() * * @return void */ - private function load() + private function load(): void { if (\count($this->attributes)) { return;