From c68e1d1fe3d77146740c9f90a66948a5a0393697 Mon Sep 17 00:00:00 2001 From: odan Date: Thu, 6 Aug 2020 14:18:10 +0200 Subject: [PATCH] Remove getStorage method from SessionInterface #7 --- src/Flash.php | 8 ++++---- src/PhpSession.php | 10 ---------- src/SessionInterface.php | 18 +++++------------- 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/src/Flash.php b/src/Flash.php index 0165e0d..2b79fa7 100644 --- a/src/Flash.php +++ b/src/Flash.php @@ -2,7 +2,7 @@ namespace Odan\Session; -use ArrayAccess; +use ArrayObject; /** * Flash messages. @@ -12,7 +12,7 @@ final class Flash implements FlashInterface /** * Message storage. * - * @var ArrayAccess + * @var ArrayObject */ private $storage; @@ -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; diff --git a/src/PhpSession.php b/src/PhpSession.php index 3654886..83563dc 100644 --- a/src/PhpSession.php +++ b/src/PhpSession.php @@ -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. * diff --git a/src/SessionInterface.php b/src/SessionInterface.php index 2a3b8b7..ac02791 100644 --- a/src/SessionInterface.php +++ b/src/SessionInterface.php @@ -2,7 +2,6 @@ namespace Odan\Session; -use ArrayObject; use Odan\Session\Exception\SessionException; /** @@ -15,13 +14,6 @@ interface SessionInterface */ public function start(): void; - /** - * Get storage. - * - * @return ArrayObject The storage - */ - public function getStorage(): ArrayObject; - /** * Get flash handler. * @@ -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,