@@ -124,15 +124,15 @@ |
||
124 | 124 | */ |
125 | 125 | public function getActiveSession(): SessionInterface |
126 | 126 | { |
127 | - try { |
|
127 | + try{ |
|
128 | 128 | $request = $this->container->get(ServerRequestInterface::class); |
129 | 129 | $session = $request->getAttribute(SessionMiddleware::ATTRIBUTE); |
130 | - if ($session === null) { |
|
130 | + if ($session === null){ |
|
131 | 131 | throw new ScopeException('Unable to receive active Session, invalid request scope'); |
132 | 132 | } |
133 | 133 | |
134 | 134 | return $session; |
135 | - } catch (NotFoundExceptionInterface $e) { |
|
135 | + }catch (NotFoundExceptionInterface $e){ |
|
136 | 136 | throw new ScopeException('Unable to receive active session', $e->getCode(), $e); |
137 | 137 | } |
138 | 138 | } |
@@ -124,15 +124,19 @@ |
||
124 | 124 | */ |
125 | 125 | public function getActiveSession(): SessionInterface |
126 | 126 | { |
127 | - try { |
|
127 | + try |
|
128 | + { |
|
128 | 129 | $request = $this->container->get(ServerRequestInterface::class); |
129 | 130 | $session = $request->getAttribute(SessionMiddleware::ATTRIBUTE); |
130 | - if ($session === null) { |
|
131 | + if ($session === null) |
|
132 | + { |
|
131 | 133 | throw new ScopeException('Unable to receive active Session, invalid request scope'); |
132 | 134 | } |
133 | 135 | |
134 | 136 | return $session; |
135 | - } catch (NotFoundExceptionInterface $e) { |
|
137 | + } |
|
138 | + catch (NotFoundExceptionInterface $e) |
|
139 | + { |
|
136 | 140 | throw new ScopeException('Unable to receive active session', $e->getCode(), $e); |
137 | 141 | } |
138 | 142 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | public function testHasCookie(): void |
37 | 37 | { |
38 | - $this->http->setHandler(function () { |
|
38 | + $this->http->setHandler(function (){ |
|
39 | 39 | return (int)$this->cookies()->has('a'); |
40 | 40 | }); |
41 | 41 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | ]); |
54 | 54 | $this->http = $this->app->get(Http::class); |
55 | 55 | |
56 | - $this->http->setHandler(function () { |
|
56 | + $this->http->setHandler(function (){ |
|
57 | 57 | return (int)$this->cookies()->has('a'); |
58 | 58 | }); |
59 | 59 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $this->app = $this->makeApp(['ENCRYPTER_KEY' => $key]); |
71 | 71 | $this->http = $this->app->get(Http::class); |
72 | 72 | |
73 | - $this->http->setHandler(function () { |
|
73 | + $this->http->setHandler(function (){ |
|
74 | 74 | return $this->cookies()->get('a'); |
75 | 75 | }); |
76 | 76 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $this->app = $this->makeApp(['ENCRYPTER_KEY' => $key]); |
88 | 88 | $this->http = $this->app->get(Http::class); |
89 | 89 | |
90 | - $this->http->setHandler(function () { |
|
90 | + $this->http->setHandler(function (){ |
|
91 | 91 | $this->cookies()->set('a', 'value'); |
92 | 92 | |
93 | 93 | return 'ok'; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $this->app = $this->makeApp(['ENCRYPTER_KEY' => $key]); |
112 | 112 | $this->http = $this->app->get(Http::class); |
113 | 113 | |
114 | - $this->http->setHandler(function () { |
|
114 | + $this->http->setHandler(function (){ |
|
115 | 115 | $this->cookies()->schedule(Cookie::create('a', 'value')); |
116 | 116 | $this->assertSame([], $this->cookies()->getAll()); |
117 | 117 |
@@ -35,7 +35,8 @@ discard block |
||
35 | 35 | |
36 | 36 | public function testHasCookie(): void |
37 | 37 | { |
38 | - $this->http->setHandler(function () { |
|
38 | + $this->http->setHandler(function () |
|
39 | + { |
|
39 | 40 | return (int)$this->cookies()->has('a'); |
40 | 41 | }); |
41 | 42 | |
@@ -53,7 +54,8 @@ discard block |
||
53 | 54 | ]); |
54 | 55 | $this->http = $this->app->get(Http::class); |
55 | 56 | |
56 | - $this->http->setHandler(function () { |
|
57 | + $this->http->setHandler(function () |
|
58 | + { |
|
57 | 59 | return (int)$this->cookies()->has('a'); |
58 | 60 | }); |
59 | 61 | |
@@ -70,7 +72,8 @@ discard block |
||
70 | 72 | $this->app = $this->makeApp(['ENCRYPTER_KEY' => $key]); |
71 | 73 | $this->http = $this->app->get(Http::class); |
72 | 74 | |
73 | - $this->http->setHandler(function () { |
|
75 | + $this->http->setHandler(function () |
|
76 | + { |
|
74 | 77 | return $this->cookies()->get('a'); |
75 | 78 | }); |
76 | 79 | |
@@ -87,7 +90,8 @@ discard block |
||
87 | 90 | $this->app = $this->makeApp(['ENCRYPTER_KEY' => $key]); |
88 | 91 | $this->http = $this->app->get(Http::class); |
89 | 92 | |
90 | - $this->http->setHandler(function () { |
|
93 | + $this->http->setHandler(function () |
|
94 | + { |
|
91 | 95 | $this->cookies()->set('a', 'value'); |
92 | 96 | |
93 | 97 | return 'ok'; |
@@ -111,7 +115,8 @@ discard block |
||
111 | 115 | $this->app = $this->makeApp(['ENCRYPTER_KEY' => $key]); |
112 | 116 | $this->http = $this->app->get(Http::class); |
113 | 117 | |
114 | - $this->http->setHandler(function () { |
|
118 | + $this->http->setHandler(function () |
|
119 | + { |
|
115 | 120 | $this->cookies()->schedule(Cookie::create('a', 'value')); |
116 | 121 | $this->assertSame([], $this->cookies()->getAll()); |
117 | 122 |