Test Failed
Push — master ( 4446e3...f73f99 )
by Vitaliy
12:08 queued 10s
created
source/Controller.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function optionAliases(): array
44 44
     {
45
-        return [];
45
+        return [ ];
46 46
     }
47 47
 
48 48
     public function showDescription(): void
@@ -134,14 +134,14 @@  discard block
 block discarded – undo
134 134
             $configList = $this->getDetector()->getConfig();
135 135
         } else {
136 136
             if (null === $this->config) {
137
-                if (isset($component->config[0])) {
137
+                if (isset($component->config[ 0 ])) {
138 138
                     $configList = $component->config;
139 139
                 } else {
140 140
                     throw new InvalidCallException('Default config list not found in component config data');
141 141
                 }
142 142
             } else {
143
-                if (isset($component->config[$this->config])) {
144
-                    $configList = $component->config[$this->config];
143
+                if (isset($component->config[ $this->config ])) {
144
+                    $configList = $component->config[ $this->config ];
145 145
                 } else {
146 146
                     throw new InvalidCallException(sprintf('Scope "%s" not found in component config data', $this->config));
147 147
                 }
Please login to merge, or discard this patch.
source/Config.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,25 +16,25 @@  discard block
 block discarded – undo
16 16
 
17 17
 class Config extends BaseObject
18 18
 {
19
-    public array $files = [];
19
+    public array $files = [ ];
20 20
     protected ?array $_config = null;
21 21
     protected ?array $_components = null;
22 22
 
23 23
     public function getComponents(): array
24 24
     {
25 25
         if (null === $this->_components) {
26
-            $this->_components = [];
26
+            $this->_components = [ ];
27 27
 
28 28
             if ($config = $this->readConfig()) {
29 29
                 foreach ($this->files as $current) {
30
-                    if (isset($config[$current]['components'])) {
30
+                    if (isset($config[ $current ][ 'components' ])) {
31 31
                         /** @var mixed[] $components */
32
-                        $components = $config[$current]['components'];
32
+                        $components = $config[ $current ][ 'components' ];
33 33
 
34 34
                         if (is_array($components)) {
35 35
                             foreach ($components as $name => $component) {
36 36
                                 if (($class = $this->findClass($component)) !== false) {
37
-                                    $this->_components[$name][$class] = $class;
37
+                                    $this->_components[ $name ][ $class ] = $class;
38 38
                                 }
39 39
                             }
40 40
                         }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     protected function readConfig(): array
50 50
     {
51 51
         if (null === $this->_config) {
52
-            $this->_config = [];
52
+            $this->_config = [ ];
53 53
 
54 54
             foreach ($this->files as $file) {
55 55
                 $path = Yii::getAlias($file);
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                 if (is_file($path)) {
59 59
                     try {
60 60
                         /** @noinspection PhpIncludeInspection */
61
-                        $this->_config[$file] = require $path;
61
+                        $this->_config[ $file ] = require $path;
62 62
                     } catch (Throwable) {
63 63
                         # Ignore
64 64
                     }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      *
75 75
      * @return string|false
76 76
      */
77
-    protected function findClass(mixed $section): bool|string
77
+    protected function findClass(mixed $section): bool | string
78 78
     {
79 79
         try {
80 80
             if ($section instanceof Closure) {
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
                 return $section;
90 90
             }
91 91
 
92
-            if (is_array($section) && isset($section['class'])) {
93
-                return $section['class'];
92
+            if (is_array($section) && isset($section[ 'class' ])) {
93
+                return $section[ 'class' ];
94 94
             }
95 95
         } catch (Throwable) {
96 96
             # Ignore
Please login to merge, or discard this patch.
source/Detector.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
         ],
37 37
     ];
38 38
 
39
-    public function detect(): bool|string
39
+    public function detect(): bool | string
40 40
     {
41 41
         $application = $this->getApplication();
42 42
 
43
-        if (isset($this->ids[$application->id])) {
44
-            return $this->ids[$application->id];
43
+        if (isset($this->ids[ $application->id ])) {
44
+            return $this->ids[ $application->id ];
45 45
         }
46 46
 
47 47
         return false;
@@ -50,15 +50,15 @@  discard block
 block discarded – undo
50 50
     public function getConfig(): array
51 51
     {
52 52
         if ($type = $this->detect()) {
53
-            return $this->configs[$type] ?? [];
53
+            return $this->configs[ $type ] ?? [ ];
54 54
         }
55 55
 
56
-        return [];
56
+        return [ ];
57 57
     }
58 58
 
59 59
     protected function getApplication(): Application
60 60
     {
61
-        if (!$this->app instanceof Application) {
61
+        if ( ! $this->app instanceof Application) {
62 62
             $this->app = Yii::$app;
63 63
         }
64 64
 
Please login to merge, or discard this patch.
source/Builder.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
13 13
 class Builder extends BaseObject
14 14
 {
15 15
     public ?string $template = null;
16
-    public array $components = [];
16
+    public array $components = [ ];
17 17
     public ?string $webAppClass = null;
18 18
     public ?string $consoleAppClass = null;
19 19
 
20
-    public function build(string|false $file = null): bool|string
20
+    public function build(string | false $file = null): bool | string
21 21
     {
22
-        $prepared = preg_replace_callback('/%.*%/U', function ($m) {
23
-            if ($m[0] === '%phpdoc%') {
22
+        $prepared = preg_replace_callback('/%.*%/U', function($m) {
23
+            if ($m[ 0 ] === '%phpdoc%') {
24 24
                 $string = '/**';
25 25
 
26 26
                 foreach ($this->components as $name => $classes) {
@@ -31,21 +31,21 @@  discard block
 block discarded – undo
31 31
                 return $string;
32 32
             }
33 33
 
34
-            if ($m[0] === '%webapp%') {
34
+            if ($m[ 0 ] === '%webapp%') {
35 35
                 return $this->webAppClass ?? '\yii\web\Application';
36 36
             }
37 37
 
38
-            if ($m[0] === '%consoleapp%') {
38
+            if ($m[ 0 ] === '%consoleapp%') {
39 39
                 return $this->consoleAppClass ?? '\yii\console\Application';
40 40
             }
41 41
 
42
-            return $m[0];
42
+            return $m[ 0 ];
43 43
         }, $this->template);
44 44
 
45 45
         if ($file === null) {
46 46
             return $prepared;
47 47
         }
48 48
 
49
-        return (bool)file_put_contents($file, $prepared);
49
+        return (bool) file_put_contents($file, $prepared);
50 50
     }
51 51
 }
Please login to merge, or discard this patch.
source/Component.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
         if (is_array($this->controllerMap)) {
44 44
             foreach ($this->controllerMap as $name => $controller) {
45 45
                 if (is_subclass_of($controller, \yii\console\Controller::class)) {
46
-                    $app->controllerMap[$name] = $controller;
46
+                    $app->controllerMap[ $name ] = $controller;
47 47
                 }
48 48
             }
49 49
         }
Please login to merge, or discard this patch.