Passed
Pull Request — master (#370)
by Valentin
04:51
created
src/AnnotatedRoutes/src/RouteLocator.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@
 block discarded – undo
33 33
     public function findDeclarations(): array
34 34
     {
35 35
         $result = [];
36
-        foreach ($this->locator->findMethods(RouteAnnotation::class) as $match) {
36
+        foreach ($this->locator->findMethods(RouteAnnotation::class) as $match)
37
+        {
37 38
             /** @var RouteAnnotation $route */
38 39
             $route = $match->getAnnotation();
39 40
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     public function findDeclarations(): array
34 34
     {
35 35
         $result = [];
36
-        foreach ($this->locator->findMethods(RouteAnnotation::class) as $match) {
36
+        foreach ($this->locator->findMethods(RouteAnnotation::class) as $match){
37 37
             /** @var RouteAnnotation $route */
38 38
             $route = $match->getAnnotation();
39 39
 
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
                 'controller' => $match->getClass()->getName(),
43 43
                 'action'     => $match->getMethod()->getName(),
44 44
                 'group'      => $route->group,
45
-                'verbs'      => (array) $route->methods,
45
+                'verbs'      => (array)$route->methods,
46 46
                 'defaults'   => $route->defaults,
47
-                'middleware' => (array) $route->middleware,
47
+                'middleware' => (array)$route->middleware,
48 48
             ];
49 49
         }
50 50
 
Please login to merge, or discard this patch.
src/AnnotatedRoutes/src/GroupRegistry.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
      */
40 40
     public function getGroup(string $name): RouteGroup
41 41
     {
42
-        if (!isset($this->groups[$name])) {
42
+        if (!isset($this->groups[$name])){
43 43
             $this->groups[$name] = $this->factory->make(RouteGroup::class);
44 44
         }
45 45
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,8 @@
 block discarded – undo
39 39
      */
40 40
     public function getGroup(string $name): RouteGroup
41 41
     {
42
-        if (!isset($this->groups[$name])) {
42
+        if (!isset($this->groups[$name]))
43
+        {
43 44
             $this->groups[$name] = $this->factory->make(RouteGroup::class);
44 45
         }
45 46
 
Please login to merge, or discard this patch.
src/AnnotatedRoutes/tests/TestCase.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@
 block discarded – undo
25 25
     protected function makeApp(array $env): App
26 26
     {
27 27
         $config = [
28
-            'root' => __DIR__ . '/App',
29
-            'app'  => __DIR__ . '/App',
28
+            'root' => __DIR__.'/App',
29
+            'app'  => __DIR__.'/App',
30 30
         ];
31 31
 
32 32
         return App::init($config, new Environment($env), false);
Please login to merge, or discard this patch.
src/AnnotatedRoutes/tests/IntegrationTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         array $headers = []
52 52
     ): ResponseInterface {
53 53
         $r = $this->request($uri, 'GET', [], $headers, []);
54
-        foreach ($attributes as $k => $v) {
54
+        foreach ($attributes as $k => $v){
55 55
             $r = $r->withAttribute($k, $v);
56 56
         }
57 57
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     public function fetchCookies(array $header)
96 96
     {
97 97
         $result = [];
98
-        foreach ($header as $line) {
98
+        foreach ($header as $line){
99 99
             $cookie = explode('=', $line);
100 100
             $result[$cookie[0]] = rawurldecode(substr($cookie[1], 0, strpos($cookie[1], ';')));
101 101
         }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,7 +51,8 @@  discard block
 block discarded – undo
51 51
         array $headers = []
52 52
     ): ResponseInterface {
53 53
         $r = $this->request($uri, 'GET', [], $headers, []);
54
-        foreach ($attributes as $k => $v) {
54
+        foreach ($attributes as $k => $v)
55
+        {
55 56
             $r = $r->withAttribute($k, $v);
56 57
         }
57 58
 
@@ -95,7 +96,8 @@  discard block
 block discarded – undo
95 96
     public function fetchCookies(array $header)
96 97
     {
97 98
         $result = [];
98
-        foreach ($header as $line) {
99
+        foreach ($header as $line)
100
+        {
99 101
             $cookie = explode('=', $line);
100 102
             $result[$cookie[0]] = rawurldecode(substr($cookie[1], 0, strpos($cookie[1], ';')));
101 103
         }
Please login to merge, or discard this patch.
src/AnnotatedRoutes/tests/CacheTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@
 block discarded – undo
28 28
 
29 29
     public function testCache(): void
30 30
     {
31
-        $this->assertFileExists(__DIR__ . '/App/runtime/cache/routes.php');
32
-        $this->assertCount(2, include __DIR__ . '/App/runtime/cache/routes.php');
31
+        $this->assertFileExists(__DIR__.'/App/runtime/cache/routes.php');
32
+        $this->assertCount(2, include __DIR__.'/App/runtime/cache/routes.php');
33 33
 
34 34
         $this->app->getConsole()->run('route:reset');
35 35
 
36
-        $this->assertSame(null, include __DIR__ . '/App/runtime/cache/routes.php');
36
+        $this->assertSame(null, include __DIR__.'/App/runtime/cache/routes.php');
37 37
     }
38 38
 }
Please login to merge, or discard this patch.
src/AnnotatedRoutes/tests/App/runtime/cache/routes.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php return array (
2
-  'index' => 
3
-  array (
2
+    'index' => 
3
+    array (
4 4
     'pattern' => '/',
5 5
     'controller' => 'Spiral\\Tests\\Router\\App\\Controller\\HomeController',
6 6
     'action' => 'index',
7 7
     'group' => 'default',
8 8
     'verbs' => 
9 9
     array (
10
-      0 => 'GET',
10
+        0 => 'GET',
11 11
     ),
12 12
     'defaults' => 
13 13
     array (
@@ -15,16 +15,16 @@  discard block
 block discarded – undo
15 15
     'middleware' => 
16 16
     array (
17 17
     ),
18
-  ),
19
-  'method' => 
20
-  array (
18
+    ),
19
+    'method' => 
20
+    array (
21 21
     'pattern' => '/',
22 22
     'controller' => 'Spiral\\Tests\\Router\\App\\Controller\\HomeController',
23 23
     'action' => 'method',
24 24
     'group' => 'default',
25 25
     'verbs' => 
26 26
     array (
27
-      0 => 'POST',
27
+        0 => 'POST',
28 28
     ),
29 29
     'defaults' => 
30 30
     array (
@@ -32,5 +32,5 @@  discard block
 block discarded – undo
32 32
     'middleware' => 
33 33
     array (
34 34
     ),
35
-  ),
35
+    ),
36 36
 );
37 37
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,36 +1,36 @@
 block discarded – undo
1
-<?php return array (
1
+<?php return array(
2 2
   'index' => 
3
-  array (
3
+  array(
4 4
     'pattern' => '/',
5 5
     'controller' => 'Spiral\\Tests\\Router\\App\\Controller\\HomeController',
6 6
     'action' => 'index',
7 7
     'group' => 'default',
8 8
     'verbs' => 
9
-    array (
9
+    array(
10 10
       0 => 'GET',
11 11
     ),
12 12
     'defaults' => 
13
-    array (
13
+    array(
14 14
     ),
15 15
     'middleware' => 
16
-    array (
16
+    array(
17 17
     ),
18 18
   ),
19 19
   'method' => 
20
-  array (
20
+  array(
21 21
     'pattern' => '/',
22 22
     'controller' => 'Spiral\\Tests\\Router\\App\\Controller\\HomeController',
23 23
     'action' => 'method',
24 24
     'group' => 'default',
25 25
     'verbs' => 
26
-    array (
26
+    array(
27 27
       0 => 'POST',
28 28
     ),
29 29
     'defaults' => 
30
-    array (
30
+    array(
31 31
     ),
32 32
     'middleware' => 
33
-    array (
33
+    array(
34 34
     ),
35 35
   ),
36 36
 );
37 37
\ No newline at end of file
Please login to merge, or discard this patch.
src/Scaffolder/src/Command/Database/EntityCommand.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         ['name', InputArgument::REQUIRED, 'Entity name'],
34 34
         ['format', InputArgument::OPTIONAL, 'Declaration format (annotated, xml?, yaml?, php?)', 'annotated'],
35 35
     ];
36
-    protected const OPTIONS     = [
36
+    protected const OPTIONS = [
37 37
         [
38 38
             'role',
39 39
             'r',
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         $declaration = $this->createDeclaration();
109 109
 
110 110
         $repository = trimPostfix((string)$this->argument('name'), 'repository');
111
-        if ($this->option('repository')) {
111
+        if ($this->option('repository')){
112 112
             $repositoryClass = $config->className(RepositoryCommand::ELEMENT, $repository);
113 113
             $repositoryNamespace = $config->classNamespace(RepositoryCommand::ELEMENT, $repository);
114 114
             $declaration->setRepository("\\$repositoryNamespace\\$repositoryClass");
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
120 120
         $declaration->setDatabase((string)$this->option('database'));
121 121
         $declaration->setInflection((string)$this->option('inflection'));
122 122
 
123
-        foreach ($this->option('field') as $field) {
124
-            if (strpos($field, ':') === false) {
123
+        foreach ($this->option('field') as $field){
124
+            if (strpos($field, ':') === false){
125 125
                 throw new ScaffolderException("Field definition must in 'name:type' or 'name:type' form");
126 126
             }
127 127
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
         $this->writeDeclaration($declaration);
137 137
 
138
-        if ($this->option('repository')) {
138
+        if ($this->option('repository')){
139 139
             $console->run('create:repository', [
140 140
                 'name' => $repository ?? $this->argument('name'),
141 141
             ]);
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             AbstractDeclaration::ACCESS_PROTECTED,
163 163
             AbstractDeclaration::ACCESS_PRIVATE,
164 164
             ], true)
165
-        ) {
165
+        ){
166 166
             throw new ScaffolderException("Invalid accessibility value `$accessibility`");
167 167
         }
168 168
     }
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -108,7 +108,8 @@  discard block
 block discarded – undo
108 108
         $declaration = $this->createDeclaration();
109 109
 
110 110
         $repository = trimPostfix((string)$this->argument('name'), 'repository');
111
-        if ($this->option('repository')) {
111
+        if ($this->option('repository'))
112
+        {
112 113
             $repositoryClass = $config->className(RepositoryCommand::ELEMENT, $repository);
113 114
             $repositoryNamespace = $config->classNamespace(RepositoryCommand::ELEMENT, $repository);
114 115
             $declaration->setRepository("\\$repositoryNamespace\\$repositoryClass");
@@ -120,8 +121,10 @@  discard block
 block discarded – undo
120 121
         $declaration->setDatabase((string)$this->option('database'));
121 122
         $declaration->setInflection((string)$this->option('inflection'));
122 123
 
123
-        foreach ($this->option('field') as $field) {
124
-            if (strpos($field, ':') === false) {
124
+        foreach ($this->option('field') as $field)
125
+        {
126
+            if (strpos($field, ':') === false)
127
+            {
125 128
                 throw new ScaffolderException("Field definition must in 'name:type' or 'name:type' form");
126 129
             }
127 130
 
@@ -135,7 +138,8 @@  discard block
 block discarded – undo
135 138
 
136 139
         $this->writeDeclaration($declaration);
137 140
 
138
-        if ($this->option('repository')) {
141
+        if ($this->option('repository'))
142
+        {
139 143
             $console->run('create:repository', [
140 144
                 'name' => $repository ?? $this->argument('name'),
141 145
             ]);
Please login to merge, or discard this patch.
src/DataGrid/tests/Fixture/WriterTwo.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
      */
24 24
     public function write($source, SpecificationInterface $specification, Compiler $compiler)
25 25
     {
26
-        if (is_array($source)) {
26
+        if (is_array($source)){
27 27
             $source[] = self::OUTPUT;
28 28
         }
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
      */
24 24
     public function write($source, SpecificationInterface $specification, Compiler $compiler)
25 25
     {
26
-        if (is_array($source)) {
26
+        if (is_array($source))
27
+        {
27 28
             $source[] = self::OUTPUT;
28 29
         }
29 30
 
Please login to merge, or discard this patch.
src/Stempler/src/Transform/Merge/Inject/InjectBlocks.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,19 +52,19 @@
 block discarded – undo
52 52
      */
53 53
     public function leaveNode($node, VisitorContext $ctx)
54 54
     {
55
-        if (!$node instanceof Block || $node->name === null || !$this->blocks->has($node->name)) {
55
+        if (!$node instanceof Block || $node->name === null || !$this->blocks->has($node->name)){
56 56
             return null;
57 57
         }
58 58
 
59 59
         $inject = $this->blocks->claim($node->name);
60 60
 
61
-        if ($inject instanceof QuotedValue) {
61
+        if ($inject instanceof QuotedValue){
62 62
             // exclude quotes
63 63
             $inject = $inject->trimvalue();
64 64
         }
65 65
 
66 66
         // mount block:parent content
67
-        if ($node->name !== 'parent') {
67
+        if ($node->name !== 'parent'){
68 68
             $traverser = new Traverser();
69 69
             $traverser->addVisitor(new InjectBlocks(new BlockClaims([
70 70
                 'parent' => $node->nodes,
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,19 +52,22 @@
 block discarded – undo
52 52
      */
53 53
     public function leaveNode($node, VisitorContext $ctx)
54 54
     {
55
-        if (!$node instanceof Block || $node->name === null || !$this->blocks->has($node->name)) {
55
+        if (!$node instanceof Block || $node->name === null || !$this->blocks->has($node->name))
56
+        {
56 57
             return null;
57 58
         }
58 59
 
59 60
         $inject = $this->blocks->claim($node->name);
60 61
 
61
-        if ($inject instanceof QuotedValue) {
62
+        if ($inject instanceof QuotedValue)
63
+        {
62 64
             // exclude quotes
63 65
             $inject = $inject->trimvalue();
64 66
         }
65 67
 
66 68
         // mount block:parent content
67
-        if ($node->name !== 'parent') {
69
+        if ($node->name !== 'parent')
70
+        {
68 71
             $traverser = new Traverser();
69 72
             $traverser->addVisitor(new InjectBlocks(new BlockClaims([
70 73
                 'parent' => $node->nodes,
Please login to merge, or discard this patch.