refactoring

This commit is contained in:
Milos Stojanovic
2019-06-14 12:46:45 +02:00
parent 667389ab1a
commit f6185c92ab
14 changed files with 1019 additions and 34 deletions

View File

@@ -40,22 +40,22 @@ class SessionStorage implements Service, SessionStorageInterface
public function save()
{
$this->getSession()->save();
return $this->getSession() !== null ? $this->getSession()->save() : false;
}
public function set(string $key, $data)
{
return $this->getSession()->set($key, $data);
return $this->getSession() !== null ? $this->getSession()->set($key, $data) : false;
}
public function get(string $key, $default = null)
{
return $this->getSession() ? $this->getSession()->get($key, $default) : $default;
return $this->getSession() !== null ? $this->getSession()->get($key, $default) : $default;
}
public function invalidate()
{
if (! $this->getSession()->isStarted()) {
if ($this->getSession() !== null || ! $this->getSession()->isStarted()) {
$this->getSession()->start();
}