Passed
Pull Request — master (#1207)
by Aleksei
10:55
created
src/Framework/Command/Tokenizer/ValidateCommand.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,8 @@
 block discarded – undo
23 23
         $listeners = \method_exists($registry, 'getListenerClasses') ? $registry->getListenerClasses() : [];
24 24
 
25 25
         $grid = $this->table(['Listener', 'Suggestion']);
26
-        foreach ($listeners as $class) {
26
+        foreach ($listeners as $class)
27
+        {
27 28
             $ref = new \ReflectionClass($class);
28 29
             $attribute = $reader->firstClassMetadata($ref, AbstractTarget::class);
29 30
             $suggestion = match (true) {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,16 +23,16 @@
 block discarded – undo
23 23
         $listeners = \method_exists($registry, 'getListenerClasses') ? $registry->getListenerClasses() : [];
24 24
 
25 25
         $grid = $this->table(['Listener', 'Suggestion']);
26
-        foreach ($listeners as $class) {
26
+        foreach ($listeners as $class){
27 27
             $ref = new \ReflectionClass($class);
28 28
             $attribute = $reader->firstClassMetadata($ref, AbstractTarget::class);
29 29
             $suggestion = match (true) {
30
-                $attribute === null => 'Add <comment>#[TargetClass]</comment> or ' .
30
+                $attribute === null => 'Add <comment>#[TargetClass]</comment> or '.
31 31
                     '<comment>#[TargetAttribute]</comment> attribute to the listener',
32 32
                 default => '<fg=green> ✓ </>',
33 33
             };
34 34
             $grid->addRow([
35
-                $class . "\n" . \sprintf(
35
+                $class."\n".\sprintf(
36 36
                     '<fg=gray>%s</>',
37 37
                     \str_replace([$dirs->get('root'), '\\'], ['', '/'], $ref->getFileName()),
38 38
                 ),
Please login to merge, or discard this patch.
src/Tokenizer/src/Bootloader/TokenizerListenerBootloader.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         ClassesLoaderInterface $loader,
131 131
         ListenerInvoker $invoker,
132 132
     ): void {
133
-        if ($config->isLoadClassesEnabled()) {
133
+        if ($config->isLoadClassesEnabled()){
134 134
             $this->loadReflections($invoker, $classes->getClasses(...), $loader->loadClasses(...));
135 135
         }
136 136
     }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         EnumsLoaderInterface $loader,
142 142
         ListenerInvoker $invoker,
143 143
     ): void {
144
-        if ($config->isLoadEnumsEnabled()) {
144
+        if ($config->isLoadEnumsEnabled()){
145 145
             $this->loadReflections($invoker, $enums->getEnums(...), $loader->loadEnums(...));
146 146
         }
147 147
     }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         InterfacesLoaderInterface $loader,
153 153
         ListenerInvoker $invoker,
154 154
     ): void {
155
-        if ($config->isLoadInterfacesEnabled()) {
155
+        if ($config->isLoadInterfacesEnabled()){
156 156
             $this->loadReflections($invoker, $interfaces->getInterfaces(...), $loader->loadInterfaces(...));
157 157
         }
158 158
     }
@@ -170,15 +170,15 @@  discard block
 block discarded – undo
170 170
 
171 171
         // First, we check if the listener has been cached. If it has, we will load the classes/enums/interfaces
172 172
         // from the cache.
173
-        foreach ($listeners as $i => $listener) {
174
-            if ($loader($listener)) {
173
+        foreach ($listeners as $i => $listener){
174
+            if ($loader($listener)){
175 175
                 unset($listeners[$i]);
176 176
             }
177 177
         }
178 178
 
179 179
         // If there are no listeners left, we don't need to use static analysis at all and save
180 180
         // valuable time.
181
-        if ($listeners === []) {
181
+        if ($listeners === []){
182 182
             return;
183 183
         }
184 184
 
@@ -186,14 +186,14 @@  discard block
 block discarded – undo
186 186
         // Please note that this is a very expensive operation and should be avoided if possible.
187 187
         // Use #[TargetClass] or #[TargetAttribute] attributes in your listeners to cache the classes/enums/interfaces.
188 188
         $classes = $reflections();
189
-        foreach ($listeners as $listener) {
189
+        foreach ($listeners as $listener){
190 190
             $invoker->invoke($listener, $classes);
191 191
         }
192 192
     }
193 193
 
194 194
     private function finalizeListeners(): void
195 195
     {
196
-        foreach ($this->listeners as $listener) {
196
+        foreach ($this->listeners as $listener){
197 197
             $listener->finalize();
198 198
         }
199 199
         // We don't need the listeners anymore, so we will clear them from memory.
Please login to merge, or discard this patch.
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -130,7 +130,8 @@  discard block
 block discarded – undo
130 130
         ClassesLoaderInterface $loader,
131 131
         ListenerInvoker $invoker,
132 132
     ): void {
133
-        if ($config->isLoadClassesEnabled()) {
133
+        if ($config->isLoadClassesEnabled())
134
+        {
134 135
             $this->loadReflections($invoker, $classes->getClasses(...), $loader->loadClasses(...));
135 136
         }
136 137
     }
@@ -141,7 +142,8 @@  discard block
 block discarded – undo
141 142
         EnumsLoaderInterface $loader,
142 143
         ListenerInvoker $invoker,
143 144
     ): void {
144
-        if ($config->isLoadEnumsEnabled()) {
145
+        if ($config->isLoadEnumsEnabled())
146
+        {
145 147
             $this->loadReflections($invoker, $enums->getEnums(...), $loader->loadEnums(...));
146 148
         }
147 149
     }
@@ -152,7 +154,8 @@  discard block
 block discarded – undo
152 154
         InterfacesLoaderInterface $loader,
153 155
         ListenerInvoker $invoker,
154 156
     ): void {
155
-        if ($config->isLoadInterfacesEnabled()) {
157
+        if ($config->isLoadInterfacesEnabled())
158
+        {
156 159
             $this->loadReflections($invoker, $interfaces->getInterfaces(...), $loader->loadInterfaces(...));
157 160
         }
158 161
     }
@@ -170,15 +173,18 @@  discard block
 block discarded – undo
170 173
 
171 174
         // First, we check if the listener has been cached. If it has, we will load the classes/enums/interfaces
172 175
         // from the cache.
173
-        foreach ($listeners as $i => $listener) {
174
-            if ($loader($listener)) {
176
+        foreach ($listeners as $i => $listener)
177
+        {
178
+            if ($loader($listener))
179
+            {
175 180
                 unset($listeners[$i]);
176 181
             }
177 182
         }
178 183
 
179 184
         // If there are no listeners left, we don't need to use static analysis at all and save
180 185
         // valuable time.
181
-        if ($listeners === []) {
186
+        if ($listeners === [])
187
+        {
182 188
             return;
183 189
         }
184 190
 
@@ -186,14 +192,16 @@  discard block
 block discarded – undo
186 192
         // Please note that this is a very expensive operation and should be avoided if possible.
187 193
         // Use #[TargetClass] or #[TargetAttribute] attributes in your listeners to cache the classes/enums/interfaces.
188 194
         $classes = $reflections();
189
-        foreach ($listeners as $listener) {
195
+        foreach ($listeners as $listener)
196
+        {
190 197
             $invoker->invoke($listener, $classes);
191 198
         }
192 199
     }
193 200
 
194 201
     private function finalizeListeners(): void
195 202
     {
196
-        foreach ($this->listeners as $listener) {
203
+        foreach ($this->listeners as $listener)
204
+        {
197 205
             $listener->finalize();
198 206
         }
199 207
         // We don't need the listeners anymore, so we will clear them from memory.
Please login to merge, or discard this patch.
src/Exceptions/src/ExceptionHandler.php 2 patches
Braces   +43 added lines, -19 removed lines patch added patch discarded remove patch
@@ -47,9 +47,12 @@  discard block
 block discarded – undo
47 47
 
48 48
     public function getRenderer(?string $format = null): ?ExceptionRendererInterface
49 49
     {
50
-        if ($format !== null) {
51
-            foreach ($this->renderers as $renderer) {
52
-                if ($renderer->canRender($format)) {
50
+        if ($format !== null)
51
+        {
52
+            foreach ($this->renderers as $renderer)
53
+            {
54
+                if ($renderer->canRender($format))
55
+                {
53 56
                     return $renderer;
54 57
                 }
55 58
             }
@@ -72,18 +75,26 @@  discard block
 block discarded – undo
72 75
 
73 76
     public function report(\Throwable $exception): void
74 77
     {
75
-        if ($this->shouldNotReport($exception)) {
78
+        if ($this->shouldNotReport($exception))
79
+        {
76 80
             return;
77 81
         }
78 82
 
79
-        foreach ($this->reporters as $reporter) {
80
-            try {
81
-                if ($reporter instanceof ExceptionReporterInterface) {
83
+        foreach ($this->reporters as $reporter)
84
+        {
85
+            try
86
+            {
87
+                if ($reporter instanceof ExceptionReporterInterface)
88
+                {
82 89
                     $reporter->report($exception);
83
-                } else {
90
+                }
91
+                else
92
+                {
84 93
                     $reporter($exception);
85 94
                 }
86
-            } catch (\Throwable) {
95
+            }
96
+            catch (\Throwable)
97
+            {
87 98
                 // Do nothing
88 99
             }
89 100
         }
@@ -91,10 +102,13 @@  discard block
 block discarded – undo
91 102
 
92 103
     public function handleGlobalException(\Throwable $e): void
93 104
     {
94
-        if (\in_array(PHP_SAPI, ['cli', 'cli-server'], true)) {
105
+        if (\in_array(PHP_SAPI, ['cli', 'cli-server'], true))
106
+        {
95 107
             $this->output ??= \defined('STDERR') ? \STDERR : \fopen('php://stderr', 'wb+');
96 108
             $format = 'cli';
97
-        } else {
109
+        }
110
+        else
111
+        {
98 112
             $this->output ??= \defined('STDOUT') ? \STDOUT : \fopen('php://stdout', 'wb+');
99 113
             $format = 'html';
100 114
         }
@@ -103,9 +117,12 @@  discard block
 block discarded – undo
103 117
         $this->report($e);
104 118
 
105 119
         // There is possible an exception on the application termination
106
-        try {
120
+        try
121
+        {
107 122
             \fwrite($this->output, $this->render($e, verbosity: $this->verbosity, format: $format));
108
-        } catch (\Throwable) {
123
+        }
124
+        catch (\Throwable)
125
+        {
109 126
             $this->output = null;
110 127
         }
111 128
     }
@@ -147,13 +164,17 @@  discard block
 block discarded – undo
147 164
      */
148 165
     protected function handleShutdown(): void
149 166
     {
150
-        if (empty($error = \error_get_last())) {
167
+        if (empty($error = \error_get_last()))
168
+        {
151 169
             return;
152 170
         }
153 171
 
154
-        try {
172
+        try
173
+        {
155 174
             $this->handleError($error['type'], $error['message'], $error['file'], $error['line']);
156
-        } catch (\Throwable $e) {
175
+        }
176
+        catch (\Throwable $e)
177
+        {
157 178
             $this->handleGlobalException($e);
158 179
         }
159 180
     }
@@ -169,7 +190,8 @@  discard block
 block discarded – undo
169 190
         string $errfile = '',
170 191
         int $errline = 0,
171 192
     ): bool {
172
-        if (!(\error_reporting() & $errno)) {
193
+        if (!(\error_reporting() & $errno))
194
+        {
173 195
             return false;
174 196
         }
175 197
 
@@ -183,8 +205,10 @@  discard block
 block discarded – undo
183 205
 
184 206
     protected function shouldNotReport(\Throwable $exception): bool
185 207
     {
186
-        foreach ($this->nonReportableExceptions as $nonReportableException) {
187
-            if ($exception instanceof $nonReportableException) {
208
+        foreach ($this->nonReportableExceptions as $nonReportableException)
209
+        {
210
+            if ($exception instanceof $nonReportableException)
211
+            {
188 212
                 return true;
189 213
             }
190 214
         }
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 
56 56
     public function getRenderer(?string $format = null): ?ExceptionRendererInterface
57 57
     {
58
-        if ($format !== null) {
59
-            foreach ($this->renderers as $renderer) {
60
-                if ($renderer->canRender($format)) {
58
+        if ($format !== null){
59
+            foreach ($this->renderers as $renderer){
60
+                if ($renderer->canRender($format)){
61 61
                     return $renderer;
62 62
                 }
63 63
             }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         ?Verbosity $verbosity = null,
71 71
         ?string $format = null,
72 72
     ): string {
73
-        return (string) $this->getRenderer($format)?->render($exception, $verbosity ?? $this->verbosity, $format);
73
+        return (string)$this->getRenderer($format)?->render($exception, $verbosity ?? $this->verbosity, $format);
74 74
     }
75 75
 
76 76
     public function canRender(string $format): bool
@@ -80,18 +80,18 @@  discard block
 block discarded – undo
80 80
 
81 81
     public function report(\Throwable $exception): void
82 82
     {
83
-        if ($this->shouldNotReport($exception)) {
83
+        if ($this->shouldNotReport($exception)){
84 84
             return;
85 85
         }
86 86
 
87
-        foreach ($this->reporters as $reporter) {
88
-            try {
89
-                if ($reporter instanceof ExceptionReporterInterface) {
87
+        foreach ($this->reporters as $reporter){
88
+            try{
89
+                if ($reporter instanceof ExceptionReporterInterface){
90 90
                     $reporter->report($exception);
91
-                } else {
91
+                }else{
92 92
                     $reporter($exception);
93 93
                 }
94
-            } catch (\Throwable) {
94
+            }catch (\Throwable){
95 95
                 // Do nothing
96 96
             }
97 97
         }
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 
100 100
     public function handleGlobalException(\Throwable $e): void
101 101
     {
102
-        if (\in_array(PHP_SAPI, ['cli', 'cli-server'], true)) {
102
+        if (\in_array(PHP_SAPI, ['cli', 'cli-server'], true)){
103 103
             $this->output ??= \defined('STDERR') ? \STDERR : \fopen('php://stderr', 'wb+');
104 104
             $format = 'cli';
105
-        } else {
105
+        }else{
106 106
             $this->output ??= \defined('STDOUT') ? \STDOUT : \fopen('php://stdout', 'wb+');
107 107
             $format = 'html';
108 108
         }
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
         $this->report($e);
112 112
 
113 113
         // There is possible an exception on the application termination
114
-        try {
114
+        try{
115 115
             \fwrite($this->output, $this->render($e, verbosity: $this->verbosity, format: $format));
116
-        } catch (\Throwable) {
116
+        }catch (\Throwable){
117 117
             $this->output = null;
118 118
         }
119 119
     }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     /**
138 138
      * @param ExceptionReporterInterface|\Closure(\Throwable):void $reporter
139 139
      */
140
-    public function addReporter(ExceptionReporterInterface|\Closure $reporter): void
140
+    public function addReporter(ExceptionReporterInterface | \Closure $reporter): void
141 141
     {
142 142
         $this->reporters[] = $reporter;
143 143
     }
@@ -155,13 +155,13 @@  discard block
 block discarded – undo
155 155
      */
156 156
     protected function handleShutdown(): void
157 157
     {
158
-        if (empty($error = \error_get_last())) {
158
+        if (empty($error = \error_get_last())){
159 159
             return;
160 160
         }
161 161
 
162
-        try {
162
+        try{
163 163
             $this->handleError($error['type'], $error['message'], $error['file'], $error['line']);
164
-        } catch (\Throwable $e) {
164
+        }catch (\Throwable $e){
165 165
             $this->handleGlobalException($e);
166 166
         }
167 167
     }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         string $errfile = '',
178 178
         int $errline = 0,
179 179
     ): bool {
180
-        if (!(\error_reporting() & $errno)) {
180
+        if (!(\error_reporting() & $errno)){
181 181
             return false;
182 182
         }
183 183
 
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
 
192 192
     protected function shouldNotReport(\Throwable $exception): bool
193 193
     {
194
-        foreach ($this->nonReportableExceptions as $nonReportableException) {
195
-            if ($exception instanceof $nonReportableException) {
194
+        foreach ($this->nonReportableExceptions as $nonReportableException){
195
+            if ($exception instanceof $nonReportableException){
196 196
                 return true;
197 197
             }
198 198
         }
Please login to merge, or discard this patch.
src/Core/tests/Internal/Proxy/Stub/MockInterfaceImpl.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
         return $name;
16 16
     }
17 17
 
18
-    public function qux(int|string $age = 42): string|int
18
+    public function qux(int | string $age = 42): string | int
19 19
     {
20 20
         return $age;
21 21
     }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     public function concat(string $prefix, string &$byLink): array
39 39
     {
40
-        $byLink = $prefix . $byLink;
40
+        $byLink = $prefix.$byLink;
41 41
         return \func_get_args();
42 42
     }
43 43
 
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 
49 49
     public function concatMultiple(string $prefix, string &...$byLink): array
50 50
     {
51
-        foreach ($byLink as $k => $link) {
52
-            $byLink[$k] = $prefix . $link;
51
+        foreach ($byLink as $k => $link){
52
+            $byLink[$k] = $prefix.$link;
53 53
             unset($link);
54 54
         }
55 55
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,8 @@
 block discarded – undo
48 48
 
49 49
     public function concatMultiple(string $prefix, string &...$byLink): array
50 50
     {
51
-        foreach ($byLink as $k => $link) {
51
+        foreach ($byLink as $k => $link)
52
+        {
52 53
             $byLink[$k] = $prefix . $link;
53 54
             unset($link);
54 55
         }
Please login to merge, or discard this patch.
src/Core/tests/Internal/Proxy/Stub/MockInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
     public function baz(string $name, int $age): string;
14 14
 
15
-    public function qux(string|int $age = 42): string|int;
15
+    public function qux(string | int $age = 42): string | int;
16 16
 
17 17
     public function space(mixed $test age = 42): mixed;
18 18
 
Please login to merge, or discard this patch.
src/Core/tests/Scope/Stub/ContextInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 
7 7
 interface ContextInterface
8 8
 {
9
-    public function getValue(): \Stringable|string|null;
9
+    public function getValue(): \Stringable | string | null;
10 10
 }
Please login to merge, or discard this patch.
src/Core/src/Internal/Proxy/ProxyTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,6 +12,6 @@
 block discarded – undo
12 12
 trait ProxyTrait
13 13
 {
14 14
     private static string $__container_proxy_alias;
15
-    private \Stringable|string|null $__container_proxy_context = null;
15
+    private \Stringable | string | null $__container_proxy_context = null;
16 16
     private ?ContainerInterface $__container_proxy_container = null;
17 17
 }
Please login to merge, or discard this patch.
src/Core/src/Internal/Proxy.php 2 patches
Braces   +14 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,9 +37,11 @@  discard block
 block discarded – undo
37 37
             $attribute->proxyOverloads ? '[magic-calls]' : '',
38 38
         );
39 39
 
40
-        if (!\array_key_exists($cacheKey, self::$classes)) {
40
+        if (!\array_key_exists($cacheKey, self::$classes))
41
+        {
41 42
             $n = 0;
42
-            do {
43
+            do
44
+            {
43 45
                 $className = \sprintf(
44 46
                     '%s\%s SCOPED PROXY%s',
45 47
                     $type->getNamespaceName(),
@@ -49,7 +51,8 @@  discard block
 block discarded – undo
49 51
             } while (\class_exists($className));
50 52
 
51 53
             /** @var class-string<TClass> $className */
52
-            try {
54
+            try
55
+            {
53 56
                 $classString = ProxyClassRenderer::renderClass(
54 57
                     $type,
55 58
                     $className,
@@ -58,7 +61,9 @@  discard block
 block discarded – undo
58 61
                 );
59 62
 
60 63
                 eval($classString);
61
-            } catch (\Throwable $e) {
64
+            }
65
+            catch (\Throwable $e)
66
+            {
62 67
                 throw new \Error("Unable to create proxy for `{$interface}`: {$e->getMessage()}", 0, $e);
63 68
             }
64 69
 
@@ -67,12 +72,15 @@  discard block
 block discarded – undo
67 72
 
68 73
             // Store in cache without context
69 74
             self::$classes[$cacheKey] = $className;
70
-        } else {
75
+        }
76
+        else
77
+        {
71 78
             /** @var TClass $instance */
72 79
             $instance = new (self::$classes[$cacheKey])();
73 80
         }
74 81
 
75
-        if ($context !== null || $attachContainer) {
82
+        if ($context !== null || $attachContainer)
83
+        {
76 84
             (static function () use ($instance, $context, $attachContainer): void {
77 85
                 // Set the Current Context
78 86
                 /** @see \Spiral\Core\Internal\Proxy\ProxyTrait::$__container_proxy_context */
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      */
23 23
     public static function create(
24 24
         \ReflectionClass $type,
25
-        \Stringable|string|null $context,
25
+        \Stringable | string | null $context,
26 26
         \Spiral\Core\Attribute\Proxy $attribute,
27 27
     ): object {
28 28
         $interface = $type->getName();
@@ -37,19 +37,19 @@  discard block
 block discarded – undo
37 37
             $attribute->proxyOverloads ? '[magic-calls]' : '',
38 38
         );
39 39
 
40
-        if (!\array_key_exists($cacheKey, self::$classes)) {
40
+        if (!\array_key_exists($cacheKey, self::$classes)){
41 41
             $n = 0;
42
-            do {
42
+            do{
43 43
                 $className = \sprintf(
44 44
                     '%s\%s SCOPED PROXY%s',
45 45
                     $type->getNamespaceName(),
46 46
                     $type->getShortName(),
47 47
                     $n++ > 0 ? " {$n}" : '',
48 48
                 );
49
-            } while (\class_exists($className));
49
+            }while (\class_exists($className));
50 50
 
51 51
             /** @var class-string<TClass> $className */
52
-            try {
52
+            try{
53 53
                 $classString = ProxyClassRenderer::renderClass(
54 54
                     $type,
55 55
                     $className,
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                 );
59 59
 
60 60
                 eval($classString);
61
-            } catch (\Throwable $e) {
61
+            }catch (\Throwable $e){
62 62
                 throw new \Error("Unable to create proxy for `{$interface}`: {$e->getMessage()}", 0, $e);
63 63
             }
64 64
 
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
67 67
 
68 68
             // Store in cache without context
69 69
             self::$classes[$cacheKey] = $className;
70
-        } else {
70
+        }else{
71 71
             /** @var TClass $instance */
72 72
             $instance = new (self::$classes[$cacheKey])();
73 73
         }
74 74
 
75
-        if ($context !== null || $attachContainer) {
75
+        if ($context !== null || $attachContainer){
76 76
             (static function () use ($instance, $context, $attachContainer): void {
77 77
                 // Set the Current Context
78 78
                 /** @see \Spiral\Core\Internal\Proxy\ProxyTrait::$__container_proxy_context */
Please login to merge, or discard this patch.
src/Core/tests/Internal/Config/StateBinderTest.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,9 @@
 block discarded – undo
46 46
         $binder = $this->constructor->get('binder', BinderInterface::class);
47 47
         $factory = $this->constructor->get('factory', FactoryInterface::class);
48 48
 
49
-        $this->bindSingleton('test', new #[Singleton] class {});
49
+        $this->bindSingleton('test', new #[Singleton] class
50
+        {
51
+});
50 52
         $factory->make('test');
51 53
 
52 54
         $this->assertTrue($binder->hasInstance('test'));
Please login to merge, or discard this patch.