@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | use Platine\Session\Exception\FileSessionHandlerException; |
| 51 | 51 | use SessionHandlerInterface; |
| 52 | 52 | |
| 53 | -class FileSessionHandler implements SessionHandlerInterface |
|
| 54 | -{ |
|
| 53 | +class FileSessionHandler implements SessionHandlerInterface { |
|
| 55 | 54 | |
| 56 | 55 | /** |
| 57 | 56 | * The path to use to save session files |
@@ -70,8 +69,7 @@ discard block |
||
| 70 | 69 | * @param string $savePath the path to directory to save session files |
| 71 | 70 | * @param string $filePrefix the session file prefix |
| 72 | 71 | */ |
| 73 | - public function __construct(string $savePath = '', string $filePrefix = 'sess_') |
|
| 74 | - { |
|
| 72 | + public function __construct(string $savePath = '', string $filePrefix = 'sess_') { |
|
| 75 | 73 | if (empty($savePath)) { |
| 76 | 74 | $savePath = sys_get_temp_dir(); |
| 77 | 75 | } |
@@ -33,7 +33,6 @@ |
||
| 33 | 33 | |
| 34 | 34 | namespace Platine\Session\Exception; |
| 35 | 35 | |
| 36 | -class SessionException extends \Exception |
|
| 37 | -{ |
|
| 36 | +class SessionException extends \Exception { |
|
| 38 | 37 | |
| 39 | 38 | } |
@@ -33,7 +33,6 @@ |
||
| 33 | 33 | |
| 34 | 34 | namespace Platine\Session\Exception; |
| 35 | 35 | |
| 36 | -class FileSessionHandlerException extends \Exception |
|
| 37 | -{ |
|
| 36 | +class FileSessionHandlerException extends \Exception { |
|
| 38 | 37 | |
| 39 | 38 | } |
@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | use Platine\Session\Exception\SessionException; |
| 51 | 51 | use SessionHandlerInterface; |
| 52 | 52 | |
| 53 | -class Session |
|
| 54 | -{ |
|
| 53 | +class Session { |
|
| 55 | 54 | |
| 56 | 55 | /** |
| 57 | 56 | * The session driver to use |
@@ -70,8 +69,7 @@ discard block |
||
| 70 | 69 | * @param SessionHandlerInterface $handler the session driver to use |
| 71 | 70 | * @param string $flashKey the session flash key |
| 72 | 71 | */ |
| 73 | - public function __construct(SessionHandlerInterface $handler, string $flashKey = 'session_flash') |
|
| 74 | - { |
|
| 72 | + public function __construct(SessionHandlerInterface $handler, string $flashKey = 'session_flash') { |
|
| 75 | 73 | if (session_status() == PHP_SESSION_ACTIVE) { |
| 76 | 74 | throw new SessionException('You don\'t need to manually start the session'); |
| 77 | 75 | } |
@@ -118,8 +116,7 @@ discard block |
||
| 118 | 116 | * @param string $key the key name |
| 119 | 117 | * @param mixed $default the default value to return if can not find session data |
| 120 | 118 | */ |
| 121 | - public function get(string $key, $default = null) |
|
| 122 | - { |
|
| 119 | + public function get(string $key, $default = null) { |
|
| 123 | 120 | return $this->has($key) ? $_SESSION[$key] : $default; |
| 124 | 121 | } |
| 125 | 122 | |
@@ -189,8 +186,7 @@ discard block |
||
| 189 | 186 | * @param string $key the key name |
| 190 | 187 | * @param mixed $default the default value to return if can not find session data |
| 191 | 188 | */ |
| 192 | - public function getFlash(string $key, $default = null) |
|
| 193 | - { |
|
| 189 | + public function getFlash(string $key, $default = null) { |
|
| 194 | 190 | $session = $this->get($this->flashKey, []); |
| 195 | 191 | $value = $default; |
| 196 | 192 | if (array_key_exists($key, $session)) { |