Skip to content

Commit

Permalink
Remove getStorage method from SessionInterface #7
Browse files Browse the repository at this point in the history
  • Loading branch information
odan committed Aug 6, 2020
1 parent 3f9c9d8 commit c68e1d1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 27 deletions.
8 changes: 4 additions & 4 deletions src/Flash.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Odan\Session;

use ArrayAccess;
use ArrayObject;

/**
* Flash messages.
Expand All @@ -12,7 +12,7 @@ final class Flash implements FlashInterface
/**
* Message storage.
*
* @var ArrayAccess
* @var ArrayObject
*/
private $storage;

Expand All @@ -26,10 +26,10 @@ final class Flash implements FlashInterface
/**
* The constructor.
*
* @param ArrayAccess $storage The storage
* @param ArrayObject $storage The storage
* @param string $storageKey The flash storage key
*/
public function __construct(ArrayAccess $storage, string $storageKey = '_flash')
public function __construct(ArrayObject $storage, string $storageKey = '_flash')
{
$this->storage = $storage;
$this->storageKey = $storageKey;
Expand Down
10 changes: 0 additions & 10 deletions src/PhpSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ public function __construct(ArrayObject $storage = null, FlashInterface $flash =
$this->flash = $flash ?? new Flash($this->storage);
}

/**
* Get storage.
*
* @return ArrayObject The storage
*/
public function getStorage(): ArrayObject
{
return $this->storage;
}

/**
* Get flash instance.
*
Expand Down
18 changes: 5 additions & 13 deletions src/SessionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Odan\Session;

use ArrayObject;
use Odan\Session\Exception\SessionException;

/**
Expand All @@ -15,13 +14,6 @@ interface SessionInterface
*/
public function start(): void;

/**
* Get storage.
*
* @return ArrayObject The storage
*/
public function getStorage(): ArrayObject;

/**
* Get flash handler.
*
Expand Down Expand Up @@ -184,11 +176,11 @@ public function getOptions(): array;
*
* @see http://php.net/manual/en/function.session-set-cookie-params.php
*
* @param int $lifetime the lifetime of the cookie in seconds
* @param string|null $path the path where information is stored
* @param string|null $domain the domain of the cookie
* @param bool $secure the cookie should only be sent over secure connections
* @param bool $httpOnly the cookie can only be accessed through the HTTP protocol
* @param int $lifetime The lifetime of the cookie in seconds
* @param string|null $path The path where information is stored
* @param string|null $domain The domain of the cookie
* @param bool $secure The cookie should only be sent over secure connections
* @param bool $httpOnly The cookie can only be accessed through the HTTP protocol
*/
public function setCookieParams(
int $lifetime,
Expand Down

0 comments on commit c68e1d1

Please sign in to comment.