@@ -233,7 +233,7 @@ |
||
| 233 | 233 | session_name($sessionName); |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - $lifetime = (int)$this->config->get('cookie.lifetime'); |
|
| 236 | + $lifetime = (int) $this->config->get('cookie.lifetime'); |
|
| 237 | 237 | $path = $this->config->get('cookie.path'); |
| 238 | 238 | $domain = $this->config->get('cookie.domain'); |
| 239 | 239 | $secure = $this->config->get('cookie.secure'); |
@@ -52,8 +52,7 @@ discard block |
||
| 52 | 52 | use Platine\Stdlib\Helper\Arr; |
| 53 | 53 | use SessionHandlerInterface; |
| 54 | 54 | |
| 55 | -class Session |
|
| 56 | -{ |
|
| 55 | +class Session { |
|
| 57 | 56 | /** |
| 58 | 57 | * The session driver to use |
| 59 | 58 | * @var SessionHandlerInterface |
@@ -124,8 +123,7 @@ discard block |
||
| 124 | 123 | * not find session data |
| 125 | 124 | * @return mixed |
| 126 | 125 | */ |
| 127 | - public function get(string $key, $default = null) |
|
| 128 | - { |
|
| 126 | + public function get(string $key, $default = null) { |
|
| 129 | 127 | return Arr::get($_SESSION, $key, $default); |
| 130 | 128 | } |
| 131 | 129 | |
@@ -180,8 +178,7 @@ discard block |
||
| 180 | 178 | * not find session data |
| 181 | 179 | * @return mixed |
| 182 | 180 | */ |
| 183 | - public function getFlash(string $key, $default = null) |
|
| 184 | - { |
|
| 181 | + public function getFlash(string $key, $default = null) { |
|
| 185 | 182 | $flashKey = $this->config->get('flash_key'); |
| 186 | 183 | $name = sprintf('%s.%s', $flashKey, $key); |
| 187 | 184 | |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | * Class NullStorage |
| 52 | 52 | * @package Platine\Session\Storage |
| 53 | 53 | */ |
| 54 | -class NullStorage extends AbstractStorage |
|
| 55 | -{ |
|
| 54 | +class NullStorage extends AbstractStorage { |
|
| 56 | 55 | /** |
| 57 | 56 | * {@inheritdoc} |
| 58 | 57 | * @see SessionHandlerInterface |
@@ -62,10 +62,10 @@ |
||
| 62 | 62 | */ |
| 63 | 63 | class LocalStorage extends AbstractStorage |
| 64 | 64 | { |
| 65 | - /** |
|
| 66 | - * The directory to use to save files |
|
| 67 | - * @var DirectoryInterface |
|
| 68 | - */ |
|
| 65 | + /** |
|
| 66 | + * The directory to use to save files |
|
| 67 | + * @var DirectoryInterface |
|
| 68 | + */ |
|
| 69 | 69 | protected DirectoryInterface $directory; |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | * Class LocalStorage |
| 61 | 61 | * @package Platine\Session\Storage |
| 62 | 62 | */ |
| 63 | -class LocalStorage extends AbstractStorage |
|
| 64 | -{ |
|
| 63 | +class LocalStorage extends AbstractStorage { |
|
| 65 | 64 | /** |
| 66 | 65 | * The directory to use to save files |
| 67 | 66 | * @var DirectoryInterface |
@@ -80,8 +79,7 @@ discard block |
||
| 80 | 79 | * @param Configuration $config |
| 81 | 80 | * @throws FileSessionHandlerException |
| 82 | 81 | */ |
| 83 | - public function __construct(Filesystem $filesystem, ?Configuration $config = null) |
|
| 84 | - { |
|
| 82 | + public function __construct(Filesystem $filesystem, ?Configuration $config = null) { |
|
| 85 | 83 | parent::__construct($config); |
| 86 | 84 | |
| 87 | 85 | $path = $this->config->get('storages.file.path'); |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | * Class AbstractStorage |
| 55 | 55 | * @package Platine\Session\Storage |
| 56 | 56 | */ |
| 57 | -abstract class AbstractStorage implements SessionHandlerInterface |
|
| 58 | -{ |
|
| 57 | +abstract class AbstractStorage implements SessionHandlerInterface { |
|
| 59 | 58 | /** |
| 60 | 59 | * The cache configuration |
| 61 | 60 | * @var Configuration |
@@ -66,8 +65,7 @@ discard block |
||
| 66 | 65 | * Create new instance |
| 67 | 66 | * @param Configuration|null $config |
| 68 | 67 | */ |
| 69 | - public function __construct(?Configuration $config = null) |
|
| 70 | - { |
|
| 68 | + public function __construct(?Configuration $config = null) { |
|
| 71 | 69 | $this->config = $config ?? new Configuration([]); |
| 72 | 70 | } |
| 73 | 71 | |
@@ -55,15 +55,13 @@ |
||
| 55 | 55 | * Class ApcuStorage |
| 56 | 56 | * @package Platine\Session\Storage |
| 57 | 57 | */ |
| 58 | -class ApcuStorage extends AbstractStorage |
|
| 59 | -{ |
|
| 58 | +class ApcuStorage extends AbstractStorage { |
|
| 60 | 59 | /** |
| 61 | 60 | * {@inheritdoc} |
| 62 | 61 | * |
| 63 | 62 | * Create new instance |
| 64 | 63 | */ |
| 65 | - public function __construct(?Configuration $config = null) |
|
| 66 | - { |
|
| 64 | + public function __construct(?Configuration $config = null) { |
|
| 67 | 65 | if ((!extension_loaded('apcu')) || !((bool) ini_get('apc.enabled'))) { |
| 68 | 66 | throw new SessionException('The session for APCu driver is not available.' |
| 69 | 67 | . ' Check if APCu extension is loaded and enabled.'); |
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | * Class Configuration |
| 54 | 54 | * @package Platine\Session |
| 55 | 55 | */ |
| 56 | -class Configuration extends AbstractConfiguration |
|
| 57 | -{ |
|
| 56 | +class Configuration extends AbstractConfiguration { |
|
| 58 | 57 | /** |
| 59 | 58 | * {@inheritdoc} |
| 60 | 59 | */ |