Test Failed
Pull Request — master (#1190)
by butschster
10:27
created
src/Boot/src/Event/Bootstrapped.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,6 +13,6 @@
 block discarded – undo
13 13
 {
14 14
     public function __construct(
15 15
         public readonly KernelInterface $kernel
16
-    ) {
16
+    ){
17 17
     }
18 18
 }
Please login to merge, or discard this patch.
src/Boot/src/helpers.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use Spiral\Core\ContainerScope;
10 10
 use Spiral\Core\Exception\ScopeException;
11 11
 
12
-if (!function_exists('spiral')) {
12
+if (!function_exists('spiral')){
13 13
     /**
14 14
      * Resolve given alias in current IoC scope.
15 15
      *
@@ -22,19 +22,19 @@  discard block
 block discarded – undo
22 22
      */
23 23
     function spiral(string $alias): mixed
24 24
     {
25
-        if (ContainerScope::getContainer() === null) {
25
+        if (ContainerScope::getContainer() === null){
26 26
             throw new ScopeException('Container scope was not set.');
27 27
         }
28 28
 
29
-        try {
29
+        try{
30 30
             return ContainerScope::getContainer()->get($alias);
31
-        } catch (ContainerExceptionInterface $e) {
31
+        }catch (ContainerExceptionInterface $e){
32 32
             throw new ScopeException($e->getMessage(), $e->getCode(), $e);
33 33
         }
34 34
     }
35 35
 }
36 36
 
37
-if (!function_exists('directory')) {
37
+if (!function_exists('directory')){
38 38
     /**
39 39
      * Get directory alias value. Uses application core from the current global scope.
40 40
      *
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     }
51 51
 }
52 52
 
53
-if (!function_exists('env')) {
53
+if (!function_exists('env')){
54 54
     /**
55 55
      * Gets the value of an environment variable. Uses application core from the current global scope.
56 56
      *
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,8 @@  discard block
 block discarded – undo
9 9
 use Spiral\Core\ContainerScope;
10 10
 use Spiral\Core\Exception\ScopeException;
11 11
 
12
-if (!function_exists('spiral')) {
12
+if (!function_exists('spiral'))
13
+{
13 14
     /**
14 15
      * Resolve given alias in current IoC scope.
15 16
      *
@@ -22,19 +23,24 @@  discard block
 block discarded – undo
22 23
      */
23 24
     function spiral(string $alias): mixed
24 25
     {
25
-        if (ContainerScope::getContainer() === null) {
26
+        if (ContainerScope::getContainer() === null)
27
+        {
26 28
             throw new ScopeException('Container scope was not set.');
27 29
         }
28 30
 
29
-        try {
31
+        try
32
+        {
30 33
             return ContainerScope::getContainer()->get($alias);
31
-        } catch (ContainerExceptionInterface $e) {
34
+        }
35
+        catch (ContainerExceptionInterface $e)
36
+        {
32 37
             throw new ScopeException($e->getMessage(), $e->getCode(), $e);
33 38
         }
34 39
     }
35 40
 }
36 41
 
37
-if (!function_exists('directory')) {
42
+if (!function_exists('directory'))
43
+{
38 44
     /**
39 45
      * Get directory alias value. Uses application core from the current global scope.
40 46
      *
@@ -50,7 +56,8 @@  discard block
 block discarded – undo
50 56
     }
51 57
 }
52 58
 
53
-if (!function_exists('env')) {
59
+if (!function_exists('env'))
60
+{
54 61
     /**
55 62
      * Gets the value of an environment variable. Uses application core from the current global scope.
56 63
      *
Please login to merge, or discard this patch.
src/Boot/src/Environment.php 2 patches
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@  discard block
 block discarded – undo
31 31
 
32 32
     public function getID(): string
33 33
     {
34
-        if (empty($this->id)) {
34
+        if (empty($this->id))
35
+        {
35 36
             $this->id = \md5(\serialize($this->values));
36 37
         }
37 38
 
@@ -40,7 +41,8 @@  discard block
 block discarded – undo
40 41
 
41 42
     public function set(string $name, mixed $value): self
42 43
     {
43
-        if (\array_key_exists($name, $this->values) && !$this->overwrite) {
44
+        if (\array_key_exists($name, $this->values) && !$this->overwrite)
45
+        {
44 46
             return $this;
45 47
         }
46 48
 
@@ -54,7 +56,8 @@  discard block
 block discarded – undo
54 56
 
55 57
     public function get(string $name, mixed $default = null): mixed
56 58
     {
57
-        if (isset($this->values[$name])) {
59
+        if (isset($this->values[$name]))
60
+        {
58 61
             return $this->normalize($this->values[$name]);
59 62
         }
60 63
 
@@ -68,7 +71,8 @@  discard block
 block discarded – undo
68 71
     {
69 72
         $result = [];
70 73
 
71
-        foreach ($this->values as $key => $value) {
74
+        foreach ($this->values as $key => $value)
75
+        {
72 76
             $result[$key] = $this->normalize($value);
73 77
         }
74 78
 
@@ -77,12 +81,14 @@  discard block
 block discarded – undo
77 81
 
78 82
     protected function normalize(mixed $value): mixed
79 83
     {
80
-        if (!\is_string($value)) {
84
+        if (!\is_string($value))
85
+        {
81 86
             return $value;
82 87
         }
83 88
 
84 89
         $alias = \strtolower($value);
85
-        if (isset(self::VALUE_MAP[$alias])) {
90
+        if (isset(self::VALUE_MAP[$alias]))
91
+        {
86 92
             return self::VALUE_MAP[$alias];
87 93
         }
88 94
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
     public function __construct(
26 26
         array $values = [],
27 27
         private readonly bool $overwrite = false
28
-    ) {
28
+    ){
29 29
         $this->values = $values + $_ENV + $_SERVER;
30 30
     }
31 31
 
32 32
     public function getID(): string
33 33
     {
34
-        if (empty($this->id)) {
34
+        if (empty($this->id)){
35 35
             $this->id = \md5(\serialize($this->values));
36 36
         }
37 37
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     public function set(string $name, mixed $value): self
42 42
     {
43
-        if (\array_key_exists($name, $this->values) && !$this->overwrite) {
43
+        if (\array_key_exists($name, $this->values) && !$this->overwrite){
44 44
             return $this;
45 45
         }
46 46
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
     public function get(string $name, mixed $default = null): mixed
56 56
     {
57
-        if (isset($this->values[$name])) {
57
+        if (isset($this->values[$name])){
58 58
             return $this->normalize($this->values[$name]);
59 59
         }
60 60
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     {
69 69
         $result = [];
70 70
 
71
-        foreach ($this->values as $key => $value) {
71
+        foreach ($this->values as $key => $value){
72 72
             $result[$key] = $this->normalize($value);
73 73
         }
74 74
 
@@ -77,12 +77,12 @@  discard block
 block discarded – undo
77 77
 
78 78
     protected function normalize(mixed $value): mixed
79 79
     {
80
-        if (!\is_string($value)) {
80
+        if (!\is_string($value)){
81 81
             return $value;
82 82
         }
83 83
 
84 84
         $alias = \strtolower($value);
85
-        if (isset(self::VALUE_MAP[$alias])) {
85
+        if (isset(self::VALUE_MAP[$alias])){
86 86
             return self::VALUE_MAP[$alias];
87 87
         }
88 88
 
Please login to merge, or discard this patch.
src/Boot/src/Injector/ProvideFrom.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,6 +11,6 @@
 block discarded – undo
11 11
 {
12 12
     public function __construct(
13 13
         public readonly string $method
14
-    ) {
14
+    ){
15 15
     }
16 16
 }
Please login to merge, or discard this patch.
src/Boot/src/Bootloader/ConfigurationBootloader.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         ContainerInterface $container,
37 37
         private readonly DirectoriesInterface $directories,
38 38
         private readonly BinderInterface $binder
39
-    ) {
39
+    ){
40 40
         $this->loaders = [
41 41
             'php' => $container->get(PhpLoader::class),
42 42
             'json' => $container->get(JsonLoader::class),
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
     public function addLoader(string $ext, FileLoaderInterface $loader): void
49 49
     {
50
-        if (!isset($this->loaders[$ext]) || $this->loaders[$ext]::class !== $loader::class) {
50
+        if (!isset($this->loaders[$ext]) || $this->loaders[$ext]::class !== $loader::class){
51 51
             $this->loaders[$ext] = $loader;
52 52
             $this->binder->bindSingleton(ConfigManager::class, $this->createConfigManager());
53 53
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,8 @@
 block discarded – undo
47 47
 
48 48
     public function addLoader(string $ext, FileLoaderInterface $loader): void
49 49
     {
50
-        if (!isset($this->loaders[$ext]) || $this->loaders[$ext]::class !== $loader::class) {
50
+        if (!isset($this->loaders[$ext]) || $this->loaders[$ext]::class !== $loader::class)
51
+        {
51 52
             $this->loaders[$ext] = $loader;
52 53
             $this->binder->bindSingleton(ConfigManager::class, $this->createConfigManager());
53 54
         }
Please login to merge, or discard this patch.
src/Boot/src/Finalizer.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     {
27 27
         $this->dispatcher?->dispatch(new Finalizing($this));
28 28
 
29
-        foreach ($this->finalizers as $finalizer) {
29
+        foreach ($this->finalizers as $finalizer){
30 30
             \call_user_func($finalizer, $terminate);
31 31
         }
32 32
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,8 @@
 block discarded – undo
26 26
     {
27 27
         $this->dispatcher?->dispatch(new Finalizing($this));
28 28
 
29
-        foreach ($this->finalizers as $finalizer) {
29
+        foreach ($this->finalizers as $finalizer)
30
+        {
30 31
             \call_user_func($finalizer, $terminate);
31 32
         }
32 33
     }
Please login to merge, or discard this patch.
src/Console/tests/ConfigureTest.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,11 +41,11 @@
 block discarded – undo
41 41
     public function testConfigure(): void
42 42
     {
43 43
         $core = $this->getCore(
44
-           $this->getStaticLocator([
45
-               HelperCommand::class,
46
-               ConfigureCommand::class,
47
-               TestCommand::class,
48
-           ])
44
+            $this->getStaticLocator([
45
+                HelperCommand::class,
46
+                ConfigureCommand::class,
47
+                TestCommand::class,
48
+            ])
49 49
         );
50 50
 
51 51
         $this->container->bind(Console::class, $core);
Please login to merge, or discard this patch.
src/Console/tests/LazyTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     public function testLazyCommandCreationInCommandLocator(): void
15 15
     {
16 16
         $locator = $this->getCommandLocator(
17
-            new class() implements ScopedClassesInterface {
17
+            new class() implements ScopedClassesInterface{
18 18
                 public function getScopedClasses(string $scope, $target = null): array
19 19
                 {
20 20
                     return [
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,8 @@
 block discarded – undo
14 14
     public function testLazyCommandCreationInCommandLocator(): void
15 15
     {
16 16
         $locator = $this->getCommandLocator(
17
-            new class() implements ScopedClassesInterface {
17
+            new class() implements ScopedClassesInterface
18
+            {
18 19
                 public function getScopedClasses(string $scope, $target = null): array
19 20
                 {
20 21
                     return [
Please login to merge, or discard this patch.
src/Console/src/Config/ConsoleConfig.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function getInterceptors(): array
40 40
     {
41
-        if (!\array_key_exists('interceptors', $this->config)) {
41
+        if (!\array_key_exists('interceptors', $this->config)){
42 42
             return [];
43 43
         }
44 44
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function getCommands(): array
52 52
     {
53
-        if (!\array_key_exists('commands', $this->config)) {
53
+        if (!\array_key_exists('commands', $this->config)){
54 54
             //Legacy config support
55 55
             return [];
56 56
         }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     {
70 70
         $sequence = (array)($this->config['sequences'][$name] ?? []);
71 71
 
72
-        foreach ($sequence as $item) {
72
+        foreach ($sequence as $item){
73 73
             yield $this->parseSequence($item);
74 74
         }
75 75
     }
@@ -108,17 +108,17 @@  discard block
 block discarded – undo
108 108
      * } $item
109 109
      * @throws \JsonException
110 110
      */
111
-    protected function parseSequence(SequenceInterface|string|array $item): SequenceInterface
111
+    protected function parseSequence(SequenceInterface | string | array $item): SequenceInterface
112 112
     {
113
-        if ($item instanceof SequenceInterface) {
113
+        if ($item instanceof SequenceInterface){
114 114
             return $item;
115 115
         }
116 116
 
117
-        if (\is_callable($item)) {
117
+        if (\is_callable($item)){
118 118
             return new CallableSequence($item);
119 119
         }
120 120
 
121
-        if (\is_array($item) && isset($item['command'])) {
121
+        if (\is_array($item) && isset($item['command'])){
122 122
             return new CommandSequence(
123 123
                 $item['command'],
124 124
                 $item['options'] ?? [],
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             );
128 128
         }
129 129
 
130
-        if (\is_array($item) && isset($item['invoke'])) {
130
+        if (\is_array($item) && isset($item['invoke'])){
131 131
             return new CallableSequence(
132 132
                 $item['invoke'],
133 133
                 $item['header'] ?? '',
Please login to merge, or discard this patch.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,7 +38,8 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function getInterceptors(): array
40 40
     {
41
-        if (!\array_key_exists('interceptors', $this->config)) {
41
+        if (!\array_key_exists('interceptors', $this->config))
42
+        {
42 43
             return [];
43 44
         }
44 45
 
@@ -50,7 +51,8 @@  discard block
 block discarded – undo
50 51
      */
51 52
     public function getCommands(): array
52 53
     {
53
-        if (!\array_key_exists('commands', $this->config)) {
54
+        if (!\array_key_exists('commands', $this->config))
55
+        {
54 56
             //Legacy config support
55 57
             return [];
56 58
         }
@@ -69,7 +71,8 @@  discard block
 block discarded – undo
69 71
     {
70 72
         $sequence = (array)($this->config['sequences'][$name] ?? []);
71 73
 
72
-        foreach ($sequence as $item) {
74
+        foreach ($sequence as $item)
75
+        {
73 76
             yield $this->parseSequence($item);
74 77
         }
75 78
     }
@@ -110,15 +113,18 @@  discard block
 block discarded – undo
110 113
      */
111 114
     protected function parseSequence(SequenceInterface|string|array $item): SequenceInterface
112 115
     {
113
-        if ($item instanceof SequenceInterface) {
116
+        if ($item instanceof SequenceInterface)
117
+        {
114 118
             return $item;
115 119
         }
116 120
 
117
-        if (\is_callable($item)) {
121
+        if (\is_callable($item))
122
+        {
118 123
             return new CallableSequence($item);
119 124
         }
120 125
 
121
-        if (\is_array($item) && isset($item['command'])) {
126
+        if (\is_array($item) && isset($item['command']))
127
+        {
122 128
             return new CommandSequence(
123 129
                 $item['command'],
124 130
                 $item['options'] ?? [],
@@ -127,7 +133,8 @@  discard block
 block discarded – undo
127 133
             );
128 134
         }
129 135
 
130
-        if (\is_array($item) && isset($item['invoke'])) {
136
+        if (\is_array($item) && isset($item['invoke']))
137
+        {
131 138
             return new CallableSequence(
132 139
                 $item['invoke'],
133 140
                 $item['header'] ?? '',
Please login to merge, or discard this patch.