Skip to content

Commit 1a5288c

Browse files
committed
Cast the key to string in the 'set' method (SessionStorageService)
1 parent 04594ee commit 1a5288c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Service/SessionStorageService.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ public function get($key)
6262
*/
6363
public function set($key, array $values, $overwrite = false)
6464
{
65+
$key = (string)$key;
66+
6567
if (!$overwrite) {
6668
$previousValues = $this->get($key);
6769
$values = array_replace($previousValues, array_filter($values));
6870
}
6971

70-
$this->session->set((string)$key, $values);
72+
$this->session->set($key, $values);
7173
return $this;
7274
}
7375

0 commit comments

Comments
 (0)