Passed
Pull Request — master (#277)
by Kirill
03:52 queued 48s
created
tests/app/src/Controller/TestController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 
49 49
     public function input(InputScope $i)
50 50
     {
51
-        return 'value: ' . $i->withPrefix('section')->getValue('query', 'value');
51
+        return 'value: '.$i->withPrefix('section')->getValue('query', 'value');
52 52
     }
53 53
 
54 54
     public function error(): void
Please login to merge, or discard this patch.
tests/app/src/Controller/AuthController.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
     public function do(GuardInterface $guard)
30 30
     {
31
-        if (!$guard->allows('do')) {
31
+        if (!$guard->allows('do')){
32 32
             throw new ControllerException("Unauthorized permission 'do'", ControllerException::FORBIDDEN);
33 33
         }
34 34
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     public function token(AuthContextInterface $authContext)
39 39
     {
40
-        if ($authContext->getToken() !== null) {
40
+        if ($authContext->getToken() !== null){
41 41
             return $authContext->getToken()->getID();
42 42
         }
43 43
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
     public function token2()
57 57
     {
58
-        if ($this->auth->getToken() !== null) {
58
+        if ($this->auth->getToken() !== null){
59 59
             return $this->auth->getToken()->getID();
60 60
         }
61 61
 
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,10 +26,12 @@  discard block
 block discarded – undo
26 26
         $this->auth = $auth;
27 27
     }
28 28
 
29
-    public function do(GuardInterface $guard)
29
+    public function do{
30
+        (GuardInterface $guard)
30 31
     {
31 32
         if (!$guard->allows('do')) {
32 33
             throw new ControllerException("Unauthorized permission 'do'", ControllerException::FORBIDDEN);
34
+    }
33 35
         }
34 36
 
35 37
         return 'ok';
@@ -37,7 +39,8 @@  discard block
 block discarded – undo
37 39
 
38 40
     public function token(AuthContextInterface $authContext)
39 41
     {
40
-        if ($authContext->getToken() !== null) {
42
+        if ($authContext->getToken() !== null)
43
+        {
41 44
             return $authContext->getToken()->getID();
42 45
         }
43 46
 
@@ -55,7 +58,8 @@  discard block
 block discarded – undo
55 58
 
56 59
     public function token2()
57 60
     {
58
-        if ($this->auth->getToken() !== null) {
61
+        if ($this->auth->getToken() !== null)
62
+        {
59 63
             return $this->auth->getToken()->getID();
60 64
         }
61 65
 
Please login to merge, or discard this patch.
tests/app/src/Controller/DemoController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,8 +40,10 @@
 block discarded – undo
40 40
      * @Guarded("do")
41 41
      * @return string
42 42
      */
43
-    public function do()
43
+    public function do{
44
+        ()
44 45
     {
45 46
         return 'ok';
46 47
     }
48
+    }
47 49
 }
Please login to merge, or discard this patch.
tests/Framework/Http/WebsocketsTest.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
     public function testAllowServerAccess(): void
40 40
     {
41
-        $this->init(static function () {
41
+        $this->init(static function (){
42 42
             return true;
43 43
         });
44 44
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
     public function testDenyServerAccess(): void
52 52
     {
53
-        $this->init(static function () {
53
+        $this->init(static function (){
54 54
             return false;
55 55
         });
56 56
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
     public function testServerAccessWithDependency(): void
64 64
     {
65
-        $this->init(static function (ServerRequestInterface $request) {
65
+        $this->init(static function (ServerRequestInterface $request){
66 66
             return $request instanceof ServerRequestInterface;
67 67
         });
68 68
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
     public function testTopicAccessOK(): void
126 126
     {
127
-        $this->init(null, function () {
127
+        $this->init(null, function (){
128 128
             return true;
129 129
         });
130 130
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
     public function testTopicWildcardAccessFail(): void
138 138
     {
139
-        $this->init(null, function () {
139
+        $this->init(null, function (){
140 140
             return true;
141 141
         });
142 142
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         $this->init(
152 152
             null,
153 153
             null,
154
-            function () {
154
+            function (){
155 155
                 return true;
156 156
             }
157 157
         );
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         $this->init(
168 168
             null,
169 169
             null,
170
-            function ($id) {
170
+            function ($id){
171 171
                 return $id === '1';
172 172
             }
173 173
         );
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         $this->init(
184 184
             null,
185 185
             null,
186
-            function ($id) {
186
+            function ($id){
187 187
                 return $id === '1';
188 188
             }
189 189
         );
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
             'CYCLE_AUTH'                 => true,
205 205
             'RR_BROADCAST_PATH'          => '/ws/',
206 206
             'WS_SERVER_CALLBACK'         => null,
207
-            'WS_TOPIC_CALLBACK'          => function (AuthContextInterface $authContext) {
207
+            'WS_TOPIC_CALLBACK'          => function (AuthContextInterface $authContext){
208 208
                 return $authContext->getToken() !== null;
209 209
             },
210 210
             'WS_TOPIC_WILDCARD_CALLBACK' => null,
Please login to merge, or discard this patch.
Braces   +18 added lines, -9 removed lines patch added patch discarded remove patch
@@ -38,7 +38,8 @@  discard block
 block discarded – undo
38 38
 
39 39
     public function testAllowServerAccess(): void
40 40
     {
41
-        $this->init(static function () {
41
+        $this->init(static function ()
42
+        {
42 43
             return true;
43 44
         });
44 45
 
@@ -50,7 +51,8 @@  discard block
 block discarded – undo
50 51
 
51 52
     public function testDenyServerAccess(): void
52 53
     {
53
-        $this->init(static function () {
54
+        $this->init(static function ()
55
+        {
54 56
             return false;
55 57
         });
56 58
 
@@ -62,7 +64,8 @@  discard block
 block discarded – undo
62 64
 
63 65
     public function testServerAccessWithDependency(): void
64 66
     {
65
-        $this->init(static function (ServerRequestInterface $request) {
67
+        $this->init(static function (ServerRequestInterface $request)
68
+        {
66 69
             return $request instanceof ServerRequestInterface;
67 70
         });
68 71
 
@@ -124,7 +127,8 @@  discard block
 block discarded – undo
124 127
 
125 128
     public function testTopicAccessOK(): void
126 129
     {
127
-        $this->init(null, function () {
130
+        $this->init(null, function ()
131
+        {
128 132
             return true;
129 133
         });
130 134
 
@@ -136,7 +140,8 @@  discard block
 block discarded – undo
136 140
 
137 141
     public function testTopicWildcardAccessFail(): void
138 142
     {
139
-        $this->init(null, function () {
143
+        $this->init(null, function ()
144
+        {
140 145
             return true;
141 146
         });
142 147
 
@@ -151,7 +156,8 @@  discard block
 block discarded – undo
151 156
         $this->init(
152 157
             null,
153 158
             null,
154
-            function () {
159
+            function ()
160
+            {
155 161
                 return true;
156 162
             }
157 163
         );
@@ -167,7 +173,8 @@  discard block
 block discarded – undo
167 173
         $this->init(
168 174
             null,
169 175
             null,
170
-            function ($id) {
176
+            function ($id)
177
+            {
171 178
                 return $id === '1';
172 179
             }
173 180
         );
@@ -183,7 +190,8 @@  discard block
 block discarded – undo
183 190
         $this->init(
184 191
             null,
185 192
             null,
186
-            function ($id) {
193
+            function ($id)
194
+            {
187 195
                 return $id === '1';
188 196
             }
189 197
         );
@@ -204,7 +212,8 @@  discard block
 block discarded – undo
204 212
             'CYCLE_AUTH'                 => true,
205 213
             'RR_BROADCAST_PATH'          => '/ws/',
206 214
             'WS_SERVER_CALLBACK'         => null,
207
-            'WS_TOPIC_CALLBACK'          => function (AuthContextInterface $authContext) {
215
+            'WS_TOPIC_CALLBACK'          => function (AuthContextInterface $authContext)
216
+            {
208 217
                 return $authContext->getToken() !== null;
209 218
             },
210 219
             'WS_TOPIC_WILDCARD_CALLBACK' => null,
Please login to merge, or discard this patch.
tests/Framework/HttpTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         array $headers = []
46 46
     ): ResponseInterface {
47 47
         $r = $this->request($uri, 'GET', [], $headers, []);
48
-        foreach ($attributes as $k => $v) {
48
+        foreach ($attributes as $k => $v){
49 49
             $r = $r->withAttribute($k, $v);
50 50
         }
51 51
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     protected function fetchCookies(array $header)
87 87
     {
88 88
         $result = [];
89
-        foreach ($header as $line) {
89
+        foreach ($header as $line){
90 90
             $cookie = explode('=', $line);
91 91
             $result[$cookie[0]] = rawurldecode(substr($cookie[1], 0, strpos($cookie[1], ';')));
92 92
         }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,8 @@  discard block
 block discarded – undo
45 45
         array $headers = []
46 46
     ): ResponseInterface {
47 47
         $r = $this->request($uri, 'GET', [], $headers, []);
48
-        foreach ($attributes as $k => $v) {
48
+        foreach ($attributes as $k => $v)
49
+        {
49 50
             $r = $r->withAttribute($k, $v);
50 51
         }
51 52
 
@@ -86,7 +87,8 @@  discard block
 block discarded – undo
86 87
     protected function fetchCookies(array $header)
87 88
     {
88 89
         $result = [];
89
-        foreach ($header as $line) {
90
+        foreach ($header as $line)
91
+        {
90 92
             $cookie = explode('=', $line);
91 93
             $result[$cookie[0]] = rawurldecode(substr($cookie[1], 0, strpos($cookie[1], ';')));
92 94
         }
Please login to merge, or discard this patch.
tests/app/src/Bootloader/AuthBootloader.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         EnvironmentInterface $env,
24 24
         BootloadManager $bootloadManager
25 25
     ): void {
26
-        if ($env->get('CYCLE_AUTH')) {
26
+        if ($env->get('CYCLE_AUTH')){
27 27
             $bootloadManager->bootload([CycleTokensBootloader::class]);
28 28
             return;
29 29
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,8 @@
 block discarded – undo
23 23
         EnvironmentInterface $env,
24 24
         BootloadManager $bootloadManager
25 25
     ): void {
26
-        if ($env->get('CYCLE_AUTH')) {
26
+        if ($env->get('CYCLE_AUTH'))
27
+        {
27 28
             $bootloadManager->bootload([CycleTokensBootloader::class]);
28 29
             return;
29 30
         }
Please login to merge, or discard this patch.
tests/app/src/Bootloader/WSBootloader.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,17 +21,17 @@
 block discarded – undo
21 21
 
22 22
     public function boot(WebsocketsBootloader $ws, EnvironmentInterface $env): void
23 23
     {
24
-        if ($env->get('RR_BROADCAST_PATH') === null) {
24
+        if ($env->get('RR_BROADCAST_PATH') === null){
25 25
             return;
26 26
         }
27 27
 
28 28
         $ws->authorizeServer($env->get('WS_SERVER_CALLBACK'));
29 29
 
30
-        if ($env->get('WS_TOPIC_CALLBACK') !== null) {
30
+        if ($env->get('WS_TOPIC_CALLBACK') !== null){
31 31
             $ws->authorizeTopic('topic', $env->get('WS_TOPIC_CALLBACK'));
32 32
         }
33 33
 
34
-        if ($env->get('WS_TOPIC_WILDCARD_CALLBACK') !== null) {
34
+        if ($env->get('WS_TOPIC_WILDCARD_CALLBACK') !== null){
35 35
             $ws->authorizeTopic('wildcard.{id}', $env->get('WS_TOPIC_WILDCARD_CALLBACK'));
36 36
         }
37 37
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,17 +21,20 @@
 block discarded – undo
21 21
 
22 22
     public function boot(WebsocketsBootloader $ws, EnvironmentInterface $env): void
23 23
     {
24
-        if ($env->get('RR_BROADCAST_PATH') === null) {
24
+        if ($env->get('RR_BROADCAST_PATH') === null)
25
+        {
25 26
             return;
26 27
         }
27 28
 
28 29
         $ws->authorizeServer($env->get('WS_SERVER_CALLBACK'));
29 30
 
30
-        if ($env->get('WS_TOPIC_CALLBACK') !== null) {
31
+        if ($env->get('WS_TOPIC_CALLBACK') !== null)
32
+        {
31 33
             $ws->authorizeTopic('topic', $env->get('WS_TOPIC_CALLBACK'));
32 34
         }
33 35
 
34
-        if ($env->get('WS_TOPIC_WILDCARD_CALLBACK') !== null) {
36
+        if ($env->get('WS_TOPIC_WILDCARD_CALLBACK') !== null)
37
+        {
35 38
             $ws->authorizeTopic('wildcard.{id}', $env->get('WS_TOPIC_WILDCARD_CALLBACK'));
36 39
         }
37 40
     }
Please login to merge, or discard this patch.
tests/Framework/I18n/ExportTest.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,8 @@
 block discarded – undo
19 19
     {
20 20
         parent::tearDown();
21 21
 
22
-        if (file_exists(sys_get_temp_dir() . '/messages.ru.php')) {
22
+        if (file_exists(sys_get_temp_dir() . '/messages.ru.php'))
23
+        {
23 24
             unlink(sys_get_temp_dir() . '/messages.ru.php');
24 25
         }
25 26
     }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@
 block discarded – undo
19 19
     {
20 20
         parent::tearDown();
21 21
 
22
-        if (file_exists(sys_get_temp_dir() . '/messages.ru.php')) {
23
-            unlink(sys_get_temp_dir() . '/messages.ru.php');
22
+        if (file_exists(sys_get_temp_dir().'/messages.ru.php')){
23
+            unlink(sys_get_temp_dir().'/messages.ru.php');
24 24
         }
25 25
     }
26 26
 
27 27
     public function testReset(): void
28 28
     {
29
-        $this->assertFileDoesNotExist(sys_get_temp_dir() . '/messages.ru.php');
29
+        $this->assertFileDoesNotExist(sys_get_temp_dir().'/messages.ru.php');
30 30
 
31 31
         $this->runCommandDebug('i18n:index');
32 32
         $this->runCommandDebug('configure');
Please login to merge, or discard this patch.
tests/Framework/Validation/EntityCheckerTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@
 block discarded – undo
142 142
             ['value' => $value] + $data,
143 143
             ['value' => [['entity::unique', User::class, $field, $fields]]]
144 144
         );
145
-        if ($context !== null) {
145
+        if ($context !== null){
146 146
             $validator = $validator->withContext($context);
147 147
         }
148 148
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,8 @@
 block discarded – undo
142 142
             ['value' => $value] + $data,
143 143
             ['value' => [['entity::unique', User::class, $field, $fields]]]
144 144
         );
145
-        if ($context !== null) {
145
+        if ($context !== null)
146
+        {
146 147
             $validator = $validator->withContext($context);
147 148
         }
148 149
 
Please login to merge, or discard this patch.