@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | use chillerlan\Settings\SettingsContainerInterface; |
17 | 17 | use Psr\Log\LoggerInterface; |
18 | 18 | |
19 | -class DBSessionHandler extends SessionHandlerAbstract{ |
|
19 | +class DBSessionHandler extends SessionHandlerAbstract { |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @var \chillerlan\Database\Database |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param \chillerlan\Settings\SettingsContainerInterface $options |
31 | 31 | * @param \Psr\Log\LoggerInterface|null $logger |
32 | 32 | */ |
33 | - public function __construct(Database $db, SettingsContainerInterface $options = null, LoggerInterface $logger = null){ |
|
33 | + public function __construct(Database $db, SettingsContainerInterface $options = null, LoggerInterface $logger = null) { |
|
34 | 34 | parent::__construct($options, $logger); |
35 | 35 | |
36 | 36 | $this->db = $db->connect(); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function read($session_id):string{ |
78 | 78 | |
79 | - if(empty($session_id)){ |
|
79 | + if (empty($session_id)) { |
|
80 | 80 | throw new SessionHandlerException('invalid session id'); |
81 | 81 | } |
82 | 82 | |
@@ -86,15 +86,15 @@ discard block |
||
86 | 86 | ->where('id', $session_id) |
87 | 87 | ->query(); |
88 | 88 | |
89 | - try{ |
|
89 | + try { |
|
90 | 90 | |
91 | - if(!$q || !isset($q[0])){ |
|
91 | + if (!$q || !isset($q[0])) { |
|
92 | 92 | return ''; |
93 | 93 | } |
94 | 94 | |
95 | 95 | return $this->options->use_encryption ? $this->decrypt($q[0]->data) : $q[0]->data; |
96 | 96 | } |
97 | - catch(\Exception $e){ |
|
97 | + catch (\Exception $e) { |
|
98 | 98 | throw new SessionHandlerException($e->getMessage()); |
99 | 99 | } |
100 | 100 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function write($session_id, $session_data):bool{ |
108 | 108 | |
109 | - if(empty($session_id)){ |
|
109 | + if (empty($session_id)) { |
|
110 | 110 | throw new SessionHandlerException('invalid session id'); |
111 | 111 | } |
112 | 112 |