Passed
Push — master ( 8b6293...069289 )
by Anton
04:46 queued 02:28
created
tests/Framework/Http/SessionTest.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 {
19 19
     public function testSetSid(): void
20 20
     {
21
-        $this->http->setHandler(function () {
21
+        $this->http->setHandler(function (){
22 22
             return ++$this->session()->getSection('cli')->value;
23 23
         });
24 24
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     public function testSessionResume(): void
34 34
     {
35
-        $this->http->setHandler(function () {
35
+        $this->http->setHandler(function (){
36 36
             return ++$this->session()->getSection('cli')->value;
37 37
         });
38 38
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
     public function testSessionRegenerateId(): void
58 58
     {
59
-        $this->http->setHandler(function () {
59
+        $this->http->setHandler(function (){
60 60
             return ++$this->session()->getSection('cli')->value;
61 61
         });
62 62
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $this->assertSame(200, $result->getStatusCode());
74 74
         $this->assertSame('2', $result->getBody()->__toString());
75 75
 
76
-        $this->http->setHandler(function () {
76
+        $this->http->setHandler(function (){
77 77
             $this->session()->regenerateID(false);
78 78
 
79 79
             return ++$this->session()->getSection('cli')->value;
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
     public function testDestroySession(): void
94 94
     {
95
-        $this->http->setHandler(function () {
95
+        $this->http->setHandler(function (){
96 96
             return ++$this->session()->getSection('cli')->value;
97 97
         });
98 98
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         ]);
106 106
         $this->assertSame(200, $result->getStatusCode());
107 107
         $this->assertSame('2', $result->getBody()->__toString());
108
-        $this->http->setHandler(function () {
108
+        $this->http->setHandler(function (){
109 109
             $this->session()->destroy();
110 110
             $this->assertFalse($this->session()->isStarted());
111 111
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@  discard block
 block discarded – undo
18 18
 {
19 19
     public function testSetSid(): void
20 20
     {
21
-        $this->http->setHandler(function () {
21
+        $this->http->setHandler(function ()
22
+        {
22 23
             return ++$this->session()->getSection('cli')->value;
23 24
         });
24 25
 
@@ -32,7 +33,8 @@  discard block
 block discarded – undo
32 33
 
33 34
     public function testSessionResume(): void
34 35
     {
35
-        $this->http->setHandler(function () {
36
+        $this->http->setHandler(function ()
37
+        {
36 38
             return ++$this->session()->getSection('cli')->value;
37 39
         });
38 40
 
@@ -56,7 +58,8 @@  discard block
 block discarded – undo
56 58
 
57 59
     public function testSessionRegenerateId(): void
58 60
     {
59
-        $this->http->setHandler(function () {
61
+        $this->http->setHandler(function ()
62
+        {
60 63
             return ++$this->session()->getSection('cli')->value;
61 64
         });
62 65
 
@@ -73,7 +76,8 @@  discard block
 block discarded – undo
73 76
         $this->assertSame(200, $result->getStatusCode());
74 77
         $this->assertSame('2', $result->getBody()->__toString());
75 78
 
76
-        $this->http->setHandler(function () {
79
+        $this->http->setHandler(function ()
80
+        {
77 81
             $this->session()->regenerateID(false);
78 82
 
79 83
             return ++$this->session()->getSection('cli')->value;
@@ -92,7 +96,8 @@  discard block
 block discarded – undo
92 96
 
93 97
     public function testDestroySession(): void
94 98
     {
95
-        $this->http->setHandler(function () {
99
+        $this->http->setHandler(function ()
100
+        {
96 101
             return ++$this->session()->getSection('cli')->value;
97 102
         });
98 103
 
@@ -105,7 +110,8 @@  discard block
 block discarded – undo
105 110
         ]);
106 111
         $this->assertSame(200, $result->getStatusCode());
107 112
         $this->assertSame('2', $result->getBody()->__toString());
108
-        $this->http->setHandler(function () {
113
+        $this->http->setHandler(function ()
114
+        {
109 115
             $this->session()->destroy();
110 116
             $this->assertFalse($this->session()->isStarted());
111 117
 
Please login to merge, or discard this patch.
tests/Framework/Http/SapiTest.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
     public function setUp(): void
27 27
     {
28
-        $this->bufferEmitter = new class() implements EmitterInterface {
28
+        $this->bufferEmitter = new class() implements EmitterInterface{
29 29
             public $response;
30 30
 
31 31
             public function emit(ResponseInterface $response): bool
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $e = $this->bufferEmitter;
60 60
 
61 61
         $files = $this->app->get(FilesInterface::class)->getFiles(
62
-            $this->app->get(DirectoriesInterface::class)->get('runtime') . '/snapshots/'
62
+            $this->app->get(DirectoriesInterface::class)->get('runtime').'/snapshots/'
63 63
         );
64 64
 
65 65
         $this->assertCount(0, $files);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $this->app->get(SapiDispatcher::class)->serve($e);
69 69
 
70 70
         $files = $this->app->get(FilesInterface::class)->getFiles(
71
-            $this->app->get(DirectoriesInterface::class)->get('runtime') . '/snapshots/'
71
+            $this->app->get(DirectoriesInterface::class)->get('runtime').'/snapshots/'
72 72
         );
73 73
 
74 74
         $this->assertCount(1, $files);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         ]);
86 86
 
87 87
         $files = $app->get(FilesInterface::class)->getFiles(
88
-            $app->get(DirectoriesInterface::class)->get('runtime') . '/snapshots/'
88
+            $app->get(DirectoriesInterface::class)->get('runtime').'/snapshots/'
89 89
         );
90 90
 
91 91
         $this->assertCount(0, $files);
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $app->get(SapiDispatcher::class)->serve($e);
95 95
 
96 96
         $files = $app->get(FilesInterface::class)->getFiles(
97
-            $app->get(DirectoriesInterface::class)->get('runtime') . '/snapshots/'
97
+            $app->get(DirectoriesInterface::class)->get('runtime').'/snapshots/'
98 98
         );
99 99
 
100 100
         $this->assertCount(1, $files);
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,8 @@
 block discarded – undo
25 25
 
26 26
     public function setUp(): void
27 27
     {
28
-        $this->bufferEmitter = new class() implements EmitterInterface {
28
+        $this->bufferEmitter = new class() implements EmitterInterface
29
+        {
29 30
             public $response;
30 31
 
31 32
             public function emit(ResponseInterface $response): bool
Please login to merge, or discard this patch.
src/Session/SessionScope.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,9 +123,9 @@
 block discarded – undo
123 123
      */
124 124
     public function getActiveSession(): SessionInterface
125 125
     {
126
-        try {
126
+        try{
127 127
             return $this->container->get(SessionInterface::class);
128
-        } catch (NotFoundExceptionInterface $e) {
128
+        }catch (NotFoundExceptionInterface $e){
129 129
             throw new ScopeException('Unable to receive active session, invalid request scope', $e->getCode(), $e);
130 130
         }
131 131
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,9 +123,12 @@
 block discarded – undo
123 123
      */
124 124
     public function getActiveSession(): SessionInterface
125 125
     {
126
-        try {
126
+        try
127
+        {
127 128
             return $this->container->get(SessionInterface::class);
128
-        } catch (NotFoundExceptionInterface $e) {
129
+        }
130
+        catch (NotFoundExceptionInterface $e)
131
+        {
129 132
             throw new ScopeException('Unable to receive active session, invalid request scope', $e->getCode(), $e);
130 133
         }
131 134
     }
Please login to merge, or discard this patch.
src/Cookies/CookieManager.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
         string $domain = null,
119 119
         bool $secure = null,
120 120
         bool $httpOnly = true
121
-    ) {
121
+    ){
122 122
         $this->getCookieQueue()->set($name, $value, $lifetime, $path, $domain, $secure, $httpOnly);
123 123
 
124 124
         return $this;
@@ -169,9 +169,9 @@  discard block
 block discarded – undo
169 169
      */
170 170
     private function getRequest(): ServerRequestInterface
171 171
     {
172
-        try {
172
+        try{
173 173
             return $this->container->get(ServerRequestInterface::class);
174
-        } catch (NotFoundExceptionInterface $e) {
174
+        }catch (NotFoundExceptionInterface $e){
175 175
             throw new ScopeException('Unable to receive active request', $e->getCode(), $e);
176 176
         }
177 177
     }
@@ -183,9 +183,9 @@  discard block
 block discarded – undo
183 183
      */
184 184
     private function getCookieQueue(): CookieQueue
185 185
     {
186
-        try {
186
+        try{
187 187
             return $this->container->get(CookieQueue::class);
188
-        } catch (NotFoundExceptionInterface $e) {
188
+        }catch (NotFoundExceptionInterface $e){
189 189
             throw new ScopeException('Unable to receive cookie queue, invalid request scope', $e->getCode(), $e);
190 190
         }
191 191
     }
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -169,9 +169,12 @@  discard block
 block discarded – undo
169 169
      */
170 170
     private function getRequest(): ServerRequestInterface
171 171
     {
172
-        try {
172
+        try
173
+        {
173 174
             return $this->container->get(ServerRequestInterface::class);
174
-        } catch (NotFoundExceptionInterface $e) {
175
+        }
176
+        catch (NotFoundExceptionInterface $e)
177
+        {
175 178
             throw new ScopeException('Unable to receive active request', $e->getCode(), $e);
176 179
         }
177 180
     }
@@ -183,9 +186,12 @@  discard block
 block discarded – undo
183 186
      */
184 187
     private function getCookieQueue(): CookieQueue
185 188
     {
186
-        try {
189
+        try
190
+        {
187 191
             return $this->container->get(CookieQueue::class);
188
-        } catch (NotFoundExceptionInterface $e) {
192
+        }
193
+        catch (NotFoundExceptionInterface $e)
194
+        {
189 195
             throw new ScopeException('Unable to receive cookie queue, invalid request scope', $e->getCode(), $e);
190 196
         }
191 197
     }
Please login to merge, or discard this patch.
src/Auth/AuthScope.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,9 +94,9 @@
 block discarded – undo
94 94
      */
95 95
     private function getAuthContext(): AuthContextInterface
96 96
     {
97
-        try {
97
+        try{
98 98
             return $this->container->get(AuthContextInterface::class);
99
-        } catch (NotFoundExceptionInterface $e) {
99
+        }catch (NotFoundExceptionInterface $e){
100 100
             throw new ScopeException('Unable to resolve auth context, invalid scope', $e->getCode(), $e);
101 101
         }
102 102
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,9 +94,12 @@
 block discarded – undo
94 94
      */
95 95
     private function getAuthContext(): AuthContextInterface
96 96
     {
97
-        try {
97
+        try
98
+        {
98 99
             return $this->container->get(AuthContextInterface::class);
99
-        } catch (NotFoundExceptionInterface $e) {
100
+        }
101
+        catch (NotFoundExceptionInterface $e)
102
+        {
100 103
             throw new ScopeException('Unable to resolve auth context, invalid scope', $e->getCode(), $e);
101 104
         }
102 105
     }
Please login to merge, or discard this patch.
src/Security/GuardScope.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         PermissionsInterface $permissions,
42 42
         ContainerInterface $actorScope,
43 43
         array $roles = []
44
-    ) {
44
+    ){
45 45
         $this->roles = $roles;
46 46
         $this->container = $actorScope;
47 47
         $this->permissions = $permissions;
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
     public function allows(string $permission, array $context = []): bool
56 56
     {
57 57
         $allows = false;
58
-        foreach ($this->getRoles() as $role) {
59
-            if (!$this->permissions->hasRole($role)) {
58
+        foreach ($this->getRoles() as $role){
59
+            if (!$this->permissions->hasRole($role)){
60 60
                 continue;
61 61
             }
62 62
 
@@ -103,13 +103,13 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function getActor(): ActorInterface
105 105
     {
106
-        if (!is_null($this->actor)) {
106
+        if (!is_null($this->actor)){
107 107
             return $this->actor;
108 108
         }
109 109
 
110
-        try {
110
+        try{
111 111
             return $this->container->get(ActorInterface::class);
112
-        } catch (NotFoundExceptionInterface $e) {
112
+        }catch (NotFoundExceptionInterface $e){
113 113
             throw new ScopeException('Unable to resolve Actor from the scope', $e->getCode(), $e);
114 114
         }
115 115
     }
Please login to merge, or discard this patch.
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -55,8 +55,10 @@  discard block
 block discarded – undo
55 55
     public function allows(string $permission, array $context = []): bool
56 56
     {
57 57
         $allows = false;
58
-        foreach ($this->getRoles() as $role) {
59
-            if (!$this->permissions->hasRole($role)) {
58
+        foreach ($this->getRoles() as $role)
59
+        {
60
+            if (!$this->permissions->hasRole($role))
61
+            {
60 62
                 continue;
61 63
             }
62 64
 
@@ -103,13 +105,17 @@  discard block
 block discarded – undo
103 105
      */
104 106
     public function getActor(): ActorInterface
105 107
     {
106
-        if (!is_null($this->actor)) {
108
+        if (!is_null($this->actor))
109
+        {
107 110
             return $this->actor;
108 111
         }
109 112
 
110
-        try {
113
+        try
114
+        {
111 115
             return $this->container->get(ActorInterface::class);
112
-        } catch (NotFoundExceptionInterface $e) {
116
+        }
117
+        catch (NotFoundExceptionInterface $e)
118
+        {
113 119
             throw new ScopeException('Unable to resolve Actor from the scope', $e->getCode(), $e);
114 120
         }
115 121
     }
Please login to merge, or discard this patch.
src/Bootloader/Auth/AuthBootloader.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function getActor(TokenInterface $token): ?object
53 53
     {
54
-        foreach ($this->getProviders() as $provider) {
55
-            if (!$provider instanceof ActorProviderInterface) {
54
+        foreach ($this->getProviders() as $provider){
55
+            if (!$provider instanceof ActorProviderInterface){
56 56
                 throw new AuthException(sprintf(
57 57
                     'Expected `ActorProviderInterface`, got `%s`',
58 58
                     get_class($provider)
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             }
61 61
 
62 62
             $actor = $provider->getActor($token);
63
-            if ($actor !== null) {
63
+            if ($actor !== null){
64 64
                 return $actor;
65 65
             }
66 66
         }
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
      */
84 84
     private function getProviders(): \Generator
85 85
     {
86
-        foreach ($this->actorProvider as $provider) {
87
-            if ($provider instanceof Autowire) {
86
+        foreach ($this->actorProvider as $provider){
87
+            if ($provider instanceof Autowire){
88 88
                 yield $provider->resolve($this->factory);
89 89
                 continue;
90 90
             }
91 91
 
92
-            if (is_object($provider)) {
92
+            if (is_object($provider)){
93 93
                 yield $provider;
94 94
                 continue;
95 95
             }
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,8 +51,10 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function getActor(TokenInterface $token): ?object
53 53
     {
54
-        foreach ($this->getProviders() as $provider) {
55
-            if (!$provider instanceof ActorProviderInterface) {
54
+        foreach ($this->getProviders() as $provider)
55
+        {
56
+            if (!$provider instanceof ActorProviderInterface)
57
+            {
56 58
                 throw new AuthException(sprintf(
57 59
                     'Expected `ActorProviderInterface`, got `%s`',
58 60
                     get_class($provider)
@@ -60,7 +62,8 @@  discard block
 block discarded – undo
60 62
             }
61 63
 
62 64
             $actor = $provider->getActor($token);
63
-            if ($actor !== null) {
65
+            if ($actor !== null)
66
+            {
64 67
                 return $actor;
65 68
             }
66 69
         }
@@ -83,13 +86,16 @@  discard block
 block discarded – undo
83 86
      */
84 87
     private function getProviders(): \Generator
85 88
     {
86
-        foreach ($this->actorProvider as $provider) {
87
-            if ($provider instanceof Autowire) {
89
+        foreach ($this->actorProvider as $provider)
90
+        {
91
+            if ($provider instanceof Autowire)
92
+            {
88 93
                 yield $provider->resolve($this->factory);
89 94
                 continue;
90 95
             }
91 96
 
92
-            if (is_object($provider)) {
97
+            if (is_object($provider))
98
+            {
93 99
                 yield $provider;
94 100
                 continue;
95 101
             }
Please login to merge, or discard this patch.
src/Bootloader/Auth/HttpAuthBootloader.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,8 +87,8 @@
 block discarded – undo
87 87
         $registry = new TransportRegistry();
88 88
         $registry->setDefaultTransport($config->getDefaultTransport());
89 89
 
90
-        foreach ($config->getTransports() as $name => $transport) {
91
-            if ($transport instanceof Autowire) {
90
+        foreach ($config->getTransports() as $name => $transport){
91
+            if ($transport instanceof Autowire){
92 92
                 $transport = $transport->resolve($factory);
93 93
             }
94 94
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,8 +87,10 @@
 block discarded – undo
87 87
         $registry = new TransportRegistry();
88 88
         $registry->setDefaultTransport($config->getDefaultTransport());
89 89
 
90
-        foreach ($config->getTransports() as $name => $transport) {
91
-            if ($transport instanceof Autowire) {
90
+        foreach ($config->getTransports() as $name => $transport)
91
+        {
92
+            if ($transport instanceof Autowire)
93
+            {
92 94
                 $transport = $transport->resolve($factory);
93 95
             }
94 96
 
Please login to merge, or discard this patch.
src/Bootloader/Auth/SecurityActorBootloader.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     private function actor(AuthContextInterface $context): ActorInterface
39 39
     {
40 40
         $actor = $context->getActor();
41
-        if ($actor instanceof ActorInterface) {
41
+        if ($actor instanceof ActorInterface){
42 42
             return $actor;
43 43
         }
44 44
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,8 @@
 block discarded – undo
38 38
     private function actor(AuthContextInterface $context): ActorInterface
39 39
     {
40 40
         $actor = $context->getActor();
41
-        if ($actor instanceof ActorInterface) {
41
+        if ($actor instanceof ActorInterface)
42
+        {
42 43
             return $actor;
43 44
         }
44 45
 
Please login to merge, or discard this patch.