@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | { |
16 | 16 | public function testSetSid() |
17 | 17 | { |
18 | - $this->http->setHandler(function () { |
|
18 | + $this->http->setHandler(function (){ |
|
19 | 19 | return ++$this->session()->getSection('cli')->value; |
20 | 20 | }); |
21 | 21 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public function testSessionResume() |
31 | 31 | { |
32 | - $this->http->setHandler(function () { |
|
32 | + $this->http->setHandler(function (){ |
|
33 | 33 | return ++$this->session()->getSection('cli')->value; |
34 | 34 | }); |
35 | 35 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | public function testSessionRegenerateId() |
55 | 55 | { |
56 | - $this->http->setHandler(function () { |
|
56 | + $this->http->setHandler(function (){ |
|
57 | 57 | return ++$this->session()->getSection('cli')->value; |
58 | 58 | }); |
59 | 59 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $this->assertSame(200, $result->getStatusCode()); |
71 | 71 | $this->assertSame('2', $result->getBody()->__toString()); |
72 | 72 | |
73 | - $this->http->setHandler(function () { |
|
73 | + $this->http->setHandler(function (){ |
|
74 | 74 | $this->session()->regenerateID(false); |
75 | 75 | |
76 | 76 | return ++$this->session()->getSection('cli')->value; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | public function testDestroySession() |
91 | 91 | { |
92 | - $this->http->setHandler(function () { |
|
92 | + $this->http->setHandler(function (){ |
|
93 | 93 | return ++$this->session()->getSection('cli')->value; |
94 | 94 | }); |
95 | 95 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | ]); |
103 | 103 | $this->assertSame(200, $result->getStatusCode()); |
104 | 104 | $this->assertSame('2', $result->getBody()->__toString()); |
105 | - $this->http->setHandler(function () { |
|
105 | + $this->http->setHandler(function (){ |
|
106 | 106 | $this->session()->destroy(); |
107 | 107 | $this->assertFalse($this->session()->isStarted()); |
108 | 108 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | public function inputAction(InputScope $i) |
48 | 48 | { |
49 | - return 'value: ' . $i->withPrefix('section')->getValue('query', 'value'); |
|
49 | + return 'value: '.$i->withPrefix('section')->getValue('query', 'value'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | public function errorAction() |
@@ -120,15 +120,15 @@ |
||
120 | 120 | */ |
121 | 121 | private function getSession(): SessionInterface |
122 | 122 | { |
123 | - try { |
|
123 | + try{ |
|
124 | 124 | $request = $this->container->get(ServerRequestInterface::class); |
125 | 125 | $session = $request->getAttribute(SessionMiddleware::ATTRIBUTE); |
126 | - if ($session === null) { |
|
126 | + if ($session === null){ |
|
127 | 127 | throw new ScopeException("Unable to receive active Session, invalid request scope"); |
128 | 128 | } |
129 | 129 | |
130 | 130 | return $session; |
131 | - } catch (NotFoundExceptionInterface $e) { |
|
131 | + }catch (NotFoundExceptionInterface $e){ |
|
132 | 132 | throw new ScopeException("Unable to receive active session", $e->getCode(), $e); |
133 | 133 | } |
134 | 134 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | CookiesConfig $cookiesConfig, |
58 | 58 | SessionFactory $factory, |
59 | 59 | ScopeInterface $scope |
60 | - ) { |
|
60 | + ){ |
|
61 | 61 | $this->config = $config; |
62 | 62 | $this->httpConfig = $httpConfig; |
63 | 63 | $this->cookiesConfig = $cookiesConfig; |
@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | $this->fetchID($request) |
77 | 77 | ); |
78 | 78 | |
79 | - try { |
|
79 | + try{ |
|
80 | 80 | $response = $handler->handle($request->withAttribute(static::ATTRIBUTE, $session)); |
81 | - } catch (\Throwable $e) { |
|
81 | + }catch (\Throwable $e){ |
|
82 | 82 | $session->abort(); |
83 | 83 | throw $e; |
84 | 84 | } |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | Request $request, |
98 | 98 | Response $response |
99 | 99 | ): Response { |
100 | - if (!$session->isStarted()) { |
|
100 | + if (!$session->isStarted()){ |
|
101 | 101 | return $response; |
102 | 102 | } |
103 | 103 | |
104 | 104 | $session->commit(); |
105 | 105 | |
106 | 106 | //SID changed |
107 | - if ($this->fetchID($request) != $session->getID()) { |
|
107 | + if ($this->fetchID($request) != $session->getID()){ |
|
108 | 108 | return $this->withCookie($request, $response, $session->getID()); |
109 | 109 | } |
110 | 110 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | protected function fetchID(Request $request): ?string |
122 | 122 | { |
123 | 123 | $cookies = $request->getCookieParams(); |
124 | - if (empty($cookies[$this->config->getCookie()])) { |
|
124 | + if (empty($cookies[$this->config->getCookie()])){ |
|
125 | 125 | return null; |
126 | 126 | } |
127 | 127 | |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | protected function clientSignature(Request $request): string |
155 | 155 | { |
156 | 156 | $signature = ''; |
157 | - foreach (static::SIGNATURE_HEADERS as $header) { |
|
158 | - $signature .= $request->getHeaderLine($header) . ';'; |
|
157 | + foreach (static::SIGNATURE_HEADERS as $header){ |
|
158 | + $signature .= $request->getHeaderLine($header).';'; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | return hash('sha256', $signature); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | string $domain = null, |
108 | 108 | bool $secure = null, |
109 | 109 | bool $httpOnly = true |
110 | - ) { |
|
110 | + ){ |
|
111 | 111 | $this->getCookieQueue()->set($name, $value, $lifetime, $path, $domain, $secure, $httpOnly); |
112 | 112 | |
113 | 113 | return $this; |
@@ -158,9 +158,9 @@ discard block |
||
158 | 158 | */ |
159 | 159 | private function getRequest(): ServerRequestInterface |
160 | 160 | { |
161 | - try { |
|
161 | + try{ |
|
162 | 162 | return $this->container->get(ServerRequestInterface::class); |
163 | - } catch (NotFoundExceptionInterface $e) { |
|
163 | + }catch (NotFoundExceptionInterface $e){ |
|
164 | 164 | throw new ScopeException("Unable to receive active request", $e->getCode(), $e); |
165 | 165 | } |
166 | 166 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | { |
175 | 175 | $request = $this->getRequest(); |
176 | 176 | $queue = $request->getAttribute(CookieQueue::ATTRIBUTE, null); |
177 | - if ($queue === null) { |
|
177 | + if ($queue === null){ |
|
178 | 178 | throw new ScopeException("Unable to receive cookie queue, invalid request scope"); |
179 | 179 | } |
180 | 180 |
@@ -71,7 +71,7 @@ |
||
71 | 71 | private function cookieQueue(ServerRequestInterface $request): CookieQueue |
72 | 72 | { |
73 | 73 | $cookieQueue = $request->getAttribute(CookieQueue::ATTRIBUTE, null); |
74 | - if ($cookieQueue === null) { |
|
74 | + if ($cookieQueue === null){ |
|
75 | 75 | throw new ScopeException("Unable to resolve CookieQueue, invalid request scope"); |
76 | 76 | } |
77 | 77 |
@@ -56,7 +56,7 @@ |
||
56 | 56 | private function route(ServerRequestInterface $request): RouteInterface |
57 | 57 | { |
58 | 58 | $route = $request->getAttribute(Router::ROUTE_ATTRIBUTE, null); |
59 | - if ($route === null) { |
|
59 | + if ($route === null){ |
|
60 | 60 | throw new ScopeException("Unable to resolve Route, invalid request scope"); |
61 | 61 | } |
62 | 62 |