@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | use chillerlan\Settings\SettingsContainerInterface; |
| 16 | 16 | |
| 17 | -class SessionCache extends CacheDriverAbstract{ |
|
| 17 | +class SessionCache extends CacheDriverAbstract { |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @var string |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | * |
| 29 | 29 | * @throws \chillerlan\SimpleCache\CacheException |
| 30 | 30 | */ |
| 31 | - public function __construct(SettingsContainerInterface $options = null){ |
|
| 31 | + public function __construct(SettingsContainerInterface $options = null) { |
|
| 32 | 32 | parent::__construct($options); |
| 33 | 33 | |
| 34 | 34 | $this->key = $this->options->cacheSessionkey; |
| 35 | 35 | |
| 36 | - if(!is_string($this->key) || empty($this->key)){ |
|
| 36 | + if (!is_string($this->key) || empty($this->key)) { |
|
| 37 | 37 | $msg = 'invalid session cache key'; |
| 38 | 38 | |
| 39 | 39 | $this->logger->error($msg); |
@@ -45,12 +45,12 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** @inheritdoc */ |
| 48 | - public function get($key, $default = null){ |
|
| 48 | + public function get($key, $default = null) { |
|
| 49 | 49 | $this->checkKey($key); |
| 50 | 50 | |
| 51 | - if(isset($_SESSION[$this->key][$key])){ |
|
| 51 | + if (isset($_SESSION[$this->key][$key])) { |
|
| 52 | 52 | |
| 53 | - if($_SESSION[$this->key][$key]['ttl'] === null || $_SESSION[$this->key][$key]['ttl'] > time()){ |
|
| 53 | + if ($_SESSION[$this->key][$key]['ttl'] === null || $_SESSION[$this->key][$key]['ttl'] > time()) { |
|
| 54 | 54 | return $_SESSION[$this->key][$key]['content']; |
| 55 | 55 | } |
| 56 | 56 | |