Skip to content

Commit

Permalink
Merge branch '6.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
odan committed Dec 4, 2022
2 parents d598c74 + 2666bd1 commit a51a93a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/MemorySession.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function getName(): string
return $this->options['name'];
}

public function get(string $key, $default = null)
public function get(string $key, mixed $default = null): mixed
{
return $this->storage[$key] ?? $default;
}
Expand All @@ -87,7 +87,7 @@ public function all(): array
return (array)$this->storage;
}

public function set(string $key, $value): void
public function set(string $key, mixed $value): void
{
$this->storage[$key] = $value;
}
Expand Down
4 changes: 2 additions & 2 deletions src/PhpSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function getName(): string
return (string)session_name();
}

public function get(string $key, $default = null)
public function get(string $key, mixed $default = null): mixed
{
return $this->storage[$key] ?? $default;
}
Expand All @@ -159,7 +159,7 @@ public function all(): array
return (array)$this->storage;
}

public function set(string $key, $value): void
public function set(string $key, mixed $value): void
{
$this->storage[$key] = $value;
}
Expand Down
10 changes: 5 additions & 5 deletions src/SessionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
namespace Odan\Session;

/**
* Interface.
* The session data operations.
*/
interface SessionInterface
{
/**
* Gets an attribute by key.
*
* @param string $key The key name or null to get all values
* @param null $default The default value
* @param mixed $default The default value
*
* @return mixed|null Should return null if the key is not found
* @return mixed The value. Returns null if the key is not found
*/
public function get(string $key, $default = null);
public function get(string $key, mixed $default = null): mixed;

/**
* Gets all values as array.
Expand All @@ -32,7 +32,7 @@ public function all(): array;
*
* @return void
*/
public function set(string $key, $value): void;
public function set(string $key, mixed $value): void;

/**
* Sets multiple attributes at once: takes a keyed array and sets each key => value pair.
Expand Down

0 comments on commit a51a93a

Please sign in to comment.