Test Failed
Pull Request — master (#963)
by butschster
09:00
created
src/Boot/src/AbstractKernel.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         protected readonly ExceptionHandlerInterface $exceptionHandler,
71 71
         protected readonly BootloadManagerInterface $bootloader,
72 72
         array $directories
73
-    ) {
73
+    ){
74 74
         $container->bindSingleton(ExceptionHandlerInterface::class, $exceptionHandler);
75 75
         $container->bindSingleton(ExceptionRendererInterface::class, $exceptionHandler);
76 76
         $container->bindSingleton(ExceptionReporterInterface::class, $exceptionHandler);
@@ -107,28 +107,28 @@  discard block
 block discarded – undo
107 107
     final public static function create(
108 108
         array $directories,
109 109
         bool $handleErrors = true,
110
-        ExceptionHandlerInterface|string|null $exceptionHandler = null,
110
+        ExceptionHandlerInterface | string | null $exceptionHandler = null,
111 111
         Container $container = new Container(),
112
-        BootloadManagerInterface|Autowire|null $bootloadManager = null
112
+        BootloadManagerInterface | Autowire | null $bootloadManager = null
113 113
     ): static {
114 114
         $exceptionHandler ??= ExceptionHandler::class;
115 115
 
116
-        if (\is_string($exceptionHandler)) {
116
+        if (\is_string($exceptionHandler)){
117 117
             $exceptionHandler = $container->make($exceptionHandler);
118 118
         }
119 119
 
120
-        if ($handleErrors) {
120
+        if ($handleErrors){
121 121
             $exceptionHandler->register();
122 122
         }
123 123
 
124
-        if (!$container->has(InitializerInterface::class)) {
124
+        if (!$container->has(InitializerInterface::class)){
125 125
             $container->bind(InitializerInterface::class, Initializer::class);
126 126
         }
127
-        if (!$container->has(InvokerStrategyInterface::class)) {
127
+        if (!$container->has(InvokerStrategyInterface::class)){
128 128
             $container->bind(InvokerStrategyInterface::class, DefaultInvokerStrategy::class);
129 129
         }
130 130
 
131
-        if ($bootloadManager instanceof Autowire) {
131
+        if ($bootloadManager instanceof Autowire){
132 132
             $bootloadManager = $bootloadManager->resolve($container);
133 133
         }
134 134
         $bootloadManager ??= $container->make(StrategyBasedBootloadManager::class);
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         $environment ??= new Environment();
161 161
         $this->container->bindSingleton(EnvironmentInterface::class, $environment);
162 162
 
163
-        try {
163
+        try{
164 164
             // will protect any against env overwrite action
165 165
             $this->container->runScope(
166 166
                 [EnvironmentInterface::class => $environment],
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                     $this->fireCallbacks($this->bootstrappedCallbacks);
175 175
                 }
176 176
             );
177
-        } catch (\Throwable $e) {
177
+        }catch (\Throwable $e){
178 178
             $this->exceptionHandler->handleGlobalException($e);
179 179
 
180 180
             return null;
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
      */
196 196
     public function running(Closure ...$callbacks): void
197 197
     {
198
-        foreach ($callbacks as $callback) {
198
+        foreach ($callbacks as $callback){
199 199
             $this->runningCallbacks[] = $callback;
200 200
         }
201 201
     }
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
      */
211 211
     public function booting(Closure ...$callbacks): void
212 212
     {
213
-        foreach ($callbacks as $callback) {
213
+        foreach ($callbacks as $callback){
214 214
             $this->bootingCallbacks[] = $callback;
215 215
         }
216 216
     }
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
      */
226 226
     public function booted(Closure ...$callbacks): void
227 227
     {
228
-        foreach ($callbacks as $callback) {
228
+        foreach ($callbacks as $callback){
229 229
             $this->bootedCallbacks[] = $callback;
230 230
         }
231 231
     }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      */
242 242
     public function bootstrapped(Closure ...$callbacks): void
243 243
     {
244
-        foreach ($callbacks as $callback) {
244
+        foreach ($callbacks as $callback){
245 245
             $this->bootstrappedCallbacks[] = $callback;
246 246
         }
247 247
     }
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
         $eventDispatcher = $this->getEventDispatcher();
270 270
         $eventDispatcher?->dispatch(new Serving());
271 271
 
272
-        foreach ($this->dispatchers as $dispatcher) {
273
-            if ($dispatcher->canServe()) {
272
+        foreach ($this->dispatchers as $dispatcher){
273
+            if ($dispatcher->canServe()){
274 274
                 return $this->container->runScope(
275 275
                     [DispatcherInterface::class => $dispatcher],
276 276
                     static function () use ($dispatcher, $eventDispatcher): mixed {
@@ -321,13 +321,13 @@  discard block
 block discarded – undo
321 321
      */
322 322
     protected function fireCallbacks(array &$callbacks): void
323 323
     {
324
-        if ($callbacks === []) {
324
+        if ($callbacks === []){
325 325
             return;
326 326
         }
327 327
 
328
-        do {
328
+        do{
329 329
             $this->container->invoke(\current($callbacks));
330
-        } while (\next($callbacks));
330
+        }while (\next($callbacks));
331 331
 
332 332
         $callbacks = [];
333 333
     }
Please login to merge, or discard this patch.
src/Framework/Bootloader/Attributes/AttributesBootloader.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
     public function __construct(
32 32
         private readonly ConfiguratorInterface $config,
33
-    ) {
33
+    ){
34 34
     }
35 35
 
36 36
     public function init(EnvironmentInterface $env): void
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
     private function initInstantiator(AttributesConfig $config): InstantiatorInterface
49 49
     {
50
-        if ($config->isAnnotationsReaderEnabled()) {
50
+        if ($config->isAnnotationsReaderEnabled()){
51 51
             return new Facade();
52 52
         }
53 53
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     ): ReaderInterface {
63 63
         $reader = new AttributeReader($instantiator);
64 64
 
65
-        if ($container->has(CacheInterface::class)) {
65
+        if ($container->has(CacheInterface::class)){
66 66
             $cache = $container->get(CacheInterface::class);
67 67
             \assert($cache instanceof CacheInterface);
68 68
 
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 
72 72
         $supportAnnotations = $config->isAnnotationsReaderEnabled();
73 73
 
74
-        if ($supportAnnotations) {
75
-            if (!\interface_exists(DoctrineReaderInterface::class)) {
74
+        if ($supportAnnotations){
75
+            if (!\interface_exists(DoctrineReaderInterface::class)){
76 76
                 throw new InitializationException(
77 77
                     'Doctrine annotations reader is not available, please install "doctrine/annotations" package',
78 78
                 );
Please login to merge, or discard this patch.
src/Tokenizer/src/Bootloader/TokenizerListenerBootloader.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         ClassesLoaderInterface $loader,
124 124
         ListenerInvoker $invoker,
125 125
     ): void {
126
-        if ($config->isLoadClassesEnabled()) {
126
+        if ($config->isLoadClassesEnabled()){
127 127
             $this->loadReflections($invoker, $classes->getClasses(...), $loader->loadClasses(...));
128 128
         }
129 129
     }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         EnumsLoaderInterface $loader,
135 135
         ListenerInvoker $invoker,
136 136
     ): void {
137
-        if ($config->isLoadEnumsEnabled()) {
137
+        if ($config->isLoadEnumsEnabled()){
138 138
             $this->loadReflections($invoker, $enums->getEnums(...), $loader->loadEnums(...));
139 139
         }
140 140
     }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         InterfacesLoaderInterface $loader,
146 146
         ListenerInvoker $invoker,
147 147
     ): void {
148
-        if ($config->isLoadInterfacesEnabled()) {
148
+        if ($config->isLoadInterfacesEnabled()){
149 149
             $this->loadReflections($invoker, $interfaces->getInterfaces(...), $loader->loadInterfaces(...));
150 150
         }
151 151
     }
@@ -163,15 +163,15 @@  discard block
 block discarded – undo
163 163
 
164 164
         // First, we check if the listener has been cached. If it has, we will load the classes/enums/interfaces
165 165
         // from the cache.
166
-        foreach ($listeners as $i => $listener) {
167
-            if (call_user_func($loader, $listener)) {
166
+        foreach ($listeners as $i => $listener){
167
+            if (call_user_func($loader, $listener)){
168 168
                 unset($listeners[$i]);
169 169
             }
170 170
         }
171 171
 
172 172
         // If there are no listeners left, we don't need to use static analysis at all and save
173 173
         // valuable time.
174
-        if ($listeners === []) {
174
+        if ($listeners === []){
175 175
             return;
176 176
         }
177 177
 
@@ -179,14 +179,14 @@  discard block
 block discarded – undo
179 179
         // Please note that this is a very expensive operation and should be avoided if possible.
180 180
         // Use #[TargetClass] or #[TargetAttribute] attributes in your listeners to cache the classes/enums/interfaces.
181 181
         $classes = call_user_func($reflections);
182
-        foreach ($listeners as $listener) {
182
+        foreach ($listeners as $listener){
183 183
             $invoker->invoke($listener, $classes);
184 184
         }
185 185
     }
186 186
 
187 187
     private function finalizeListeners(): void
188 188
     {
189
-        foreach ($this->listeners as $listener) {
189
+        foreach ($this->listeners as $listener){
190 190
             $listener->finalize();
191 191
         }
192 192
         // We don't need the listeners anymore, so we will clear them from memory.
Please login to merge, or discard this patch.
src/Tokenizer/src/Bootloader/TokenizerBootloader.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
     public function __construct(
47 47
         private readonly ConfiguratorInterface $config,
48
-    ) {
48
+    ){
49 49
     }
50 50
 
51 51
     public function init(BinderInterface $binder, DirectoriesInterface $dirs, EnvironmentInterface $env): void
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                     'migrations',
68 68
                 ],
69 69
                 'cache' => [
70
-                    'directory' => $dirs->get('runtime') . 'cache/listeners',
70
+                    'directory' => $dirs->get('runtime').'cache/listeners',
71 71
                     'enabled' => \filter_var($env->get('TOKENIZER_CACHE_TARGETS', false), \FILTER_VALIDATE_BOOL),
72 72
                 ],
73 73
             ],
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public function addScopedDirectory(string $scope, string $directory): void
92 92
     {
93
-        if (!isset($this->config->getConfig(TokenizerConfig::CONFIG)['scopes'][$scope])) {
93
+        if (!isset($this->config->getConfig(TokenizerConfig::CONFIG)['scopes'][$scope])){
94 94
             $this->config->modify(
95 95
                 TokenizerConfig::CONFIG,
96 96
                 new Append('scopes', $scope, []),
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
         $this->config->modify(
101 101
             TokenizerConfig::CONFIG,
102
-            new Append('scopes.' . $scope, null, $directory),
102
+            new Append('scopes.'.$scope, null, $directory),
103 103
         );
104 104
     }
105 105
 }
Please login to merge, or discard this patch.