From 66f82d8adc42b0d3a4f362ce588b5a9814d49cca Mon Sep 17 00:00:00 2001 From: Awilum Date: Tue, 24 Nov 2020 19:38:51 +0300 Subject: [PATCH] feat(entries): update methods getStorage() setStorage() #467 --- src/flextype/Foundation/Entries/Entries.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/flextype/Foundation/Entries/Entries.php b/src/flextype/Foundation/Entries/Entries.php index 81914266..05b9008f 100755 --- a/src/flextype/Foundation/Entries/Entries.php +++ b/src/flextype/Foundation/Entries/Entries.php @@ -29,27 +29,28 @@ class Entries * and maybe changed on fly. * * @var array - * @access public + * @access private */ private $storage = []; /** * Get storage * - * @param string Key + * @param string|int|null $key Key + * @param mixed $default Default value */ - public function getStorage(string $key) + public function getStorage($key, $default = null) { - return arrays($this->storage)->get($key); + return arrays($this->storage)->get($key, $default); } /** * Set storage * - * @param string Key - * @param mixed Value + * @param string|null $key Key + * @param mixed $value Value */ - public function setStorage(string $key, $value) + public function setStorage(?string $key, $value) { $this->storage = arrays($this->storage)->set($key, $value)->toArray(); }