Passed
Push — master ( 9f8f80...2ee547 )
by Aleksei
06:30 queued 17s
created
src/Router/src/Loader/Configurator/RoutingConfigurator.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,12 +21,14 @@
 block discarded – undo
21 21
     {
22 22
         $imported = $this->loader->load($resource, $type) ?: [];
23 23
 
24
-        if (!\is_array($imported)) {
24
+        if (!\is_array($imported))
25
+        {
25 26
             return new ImportConfigurator($this->collection, $imported);
26 27
         }
27 28
 
28 29
         $mergedCollection = new RouteCollection();
29
-        foreach ($imported as $subCollection) {
30
+        foreach ($imported as $subCollection)
31
+        {
30 32
             $mergedCollection->addCollection($subCollection);
31 33
         }
32 34
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,19 +14,19 @@
 block discarded – undo
14 14
     public function __construct(
15 15
         private readonly RouteCollection $collection,
16 16
         private readonly LoaderInterface $loader
17
-    ) {
17
+    ){
18 18
     }
19 19
 
20
-    public function import(string|array $resource, ?string $type = null): ImportConfigurator
20
+    public function import(string | array $resource, ?string $type = null): ImportConfigurator
21 21
     {
22 22
         $imported = $this->loader->load($resource, $type) ?: [];
23 23
 
24
-        if (!\is_array($imported)) {
24
+        if (!\is_array($imported)){
25 25
             return new ImportConfigurator($this->collection, $imported);
26 26
         }
27 27
 
28 28
         $mergedCollection = new RouteCollection();
29
-        foreach ($imported as $subCollection) {
29
+        foreach ($imported as $subCollection){
30 30
             $mergedCollection->addCollection($subCollection);
31 31
         }
32 32
 
Please login to merge, or discard this patch.
src/Router/src/PipelineFactory.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     public function __construct(
18 18
         private readonly ContainerInterface $container,
19 19
         private readonly FactoryInterface $factory
20
-    ) {
20
+    ){
21 21
     }
22 22
 
23 23
     /**
@@ -26,27 +26,27 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function createWithMiddleware(array $middleware): Pipeline
28 28
     {
29
-        if (\count($middleware) === 1 && $middleware[0] instanceof Pipeline) {
29
+        if (\count($middleware) === 1 && $middleware[0] instanceof Pipeline){
30 30
             return $middleware[0];
31 31
         }
32 32
 
33 33
         $pipeline = $this->factory->make(Pipeline::class);
34 34
         \assert($pipeline instanceof Pipeline);
35 35
 
36
-        foreach ($middleware as $item) {
37
-            if ($item instanceof MiddlewareInterface) {
36
+        foreach ($middleware as $item){
37
+            if ($item instanceof MiddlewareInterface){
38 38
                 $pipeline->pushMiddleware($item);
39
-            } elseif (\is_string($item)) {
39
+            } elseif (\is_string($item)){
40 40
                 $item = $this->container->get($item);
41 41
                 \assert($item instanceof MiddlewareInterface);
42 42
 
43 43
                 $pipeline->pushMiddleware($item);
44
-            } elseif ($item instanceof Autowire) {
44
+            } elseif ($item instanceof Autowire){
45 45
                 $item = $item->resolve($this->factory);
46 46
                 \assert($item instanceof MiddlewareInterface);
47 47
 
48 48
                 $pipeline->pushMiddleware($item);
49
-            } else {
49
+            }else{
50 50
                 $name = get_debug_type($item);
51 51
                 throw new RouteException(\sprintf('Invalid middleware `%s`', $name));
52 52
             }
Please login to merge, or discard this patch.
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,27 +26,36 @@
 block discarded – undo
26 26
      */
27 27
     public function createWithMiddleware(array $middleware): Pipeline
28 28
     {
29
-        if (\count($middleware) === 1 && $middleware[0] instanceof Pipeline) {
29
+        if (\count($middleware) === 1 && $middleware[0] instanceof Pipeline)
30
+        {
30 31
             return $middleware[0];
31 32
         }
32 33
 
33 34
         $pipeline = $this->factory->make(Pipeline::class);
34 35
         \assert($pipeline instanceof Pipeline);
35 36
 
36
-        foreach ($middleware as $item) {
37
-            if ($item instanceof MiddlewareInterface) {
37
+        foreach ($middleware as $item)
38
+        {
39
+            if ($item instanceof MiddlewareInterface)
40
+            {
38 41
                 $pipeline->pushMiddleware($item);
39
-            } elseif (\is_string($item)) {
42
+            }
43
+            elseif (\is_string($item))
44
+            {
40 45
                 $item = $this->container->get($item);
41 46
                 \assert($item instanceof MiddlewareInterface);
42 47
 
43 48
                 $pipeline->pushMiddleware($item);
44
-            } elseif ($item instanceof Autowire) {
49
+            }
50
+            elseif ($item instanceof Autowire)
51
+            {
45 52
                 $item = $item->resolve($this->factory);
46 53
                 \assert($item instanceof MiddlewareInterface);
47 54
 
48 55
                 $pipeline->pushMiddleware($item);
49
-            } else {
56
+            }
57
+            else
58
+            {
50 59
                 $name = get_debug_type($item);
51 60
                 throw new RouteException(\sprintf('Invalid middleware `%s`', $name));
52 61
             }
Please login to merge, or discard this patch.
src/Router/src/Traits/VerbsTrait.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@
 block discarded – undo
19 19
      */
20 20
     public function withVerbs(string ...$verbs): RouteInterface
21 21
     {
22
-        foreach ($verbs as &$verb) {
22
+        foreach ($verbs as &$verb){
23 23
             $verb = \strtoupper($verb);
24
-            if (!\in_array($verb, RouteInterface::VERBS, true)) {
24
+            if (!\in_array($verb, RouteInterface::VERBS, true)){
25 25
                 throw new RouteException(\sprintf('Invalid HTTP verb `%s`', $verb));
26 26
             }
27 27
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,9 +19,11 @@
 block discarded – undo
19 19
      */
20 20
     public function withVerbs(string ...$verbs): RouteInterface
21 21
     {
22
-        foreach ($verbs as &$verb) {
22
+        foreach ($verbs as &$verb)
23
+        {
23 24
             $verb = \strtoupper($verb);
24
-            if (!\in_array($verb, RouteInterface::VERBS, true)) {
25
+            if (!\in_array($verb, RouteInterface::VERBS, true))
26
+            {
25 27
                 throw new RouteException(\sprintf('Invalid HTTP verb `%s`', $verb));
26 28
             }
27 29
 
Please login to merge, or discard this patch.
src/Router/src/Event/Routing.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,6 +10,6 @@
 block discarded – undo
10 10
 {
11 11
     public function __construct(
12 12
         public readonly ServerRequestInterface $request
13
-    ) {
13
+    ){
14 14
     }
15 15
 }
Please login to merge, or discard this patch.
src/Router/src/Event/RouteMatched.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
     public function __construct(
13 13
         public readonly ServerRequestInterface $request,
14 14
         public readonly RouteInterface $route,
15
-    ) {
15
+    ){
16 16
     }
17 17
 }
Please login to merge, or discard this patch.
src/Router/src/Autofill.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function __construct(
10 10
         private readonly string $value
11
-    ) {
11
+    ){
12 12
     }
13 13
 
14 14
     public function __toString(): string
Please login to merge, or discard this patch.
src/Router/src/Target/Controller.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
         private readonly string $controller,
16 16
         int $options = 0,
17 17
         string $defaultAction = 'index'
18
-    ) {
18
+    ){
19 19
         parent::__construct(
20 20
             ['action' => null],
21 21
             ['action' => null],
Please login to merge, or discard this patch.
src/Router/src/Target/Group.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
         private readonly array $controllers,
16 16
         int $options = 0,
17 17
         string $defaultAction = 'index'
18
-    ) {
18
+    ){
19 19
         parent::__construct(
20 20
             ['controller' => null, 'action' => null],
21 21
             ['controller' => \array_keys($controllers), 'action' => null],
Please login to merge, or discard this patch.
src/Router/src/Target/Action.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,16 +23,16 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function __construct(
25 25
         private readonly string $controller,
26
-        private readonly string|array $action,
26
+        private readonly string | array $action,
27 27
         int $options = 0
28
-    ) {
29
-        if (\is_string($action)) {
28
+    ){
29
+        if (\is_string($action)){
30 30
             parent::__construct(
31 31
                 ['action' => $action],
32 32
                 ['action' => new Autofill($action)],
33 33
                 $options
34 34
             );
35
-        } else {
35
+        }else{
36 36
             parent::__construct(
37 37
                 ['action' => null],
38 38
                 ['action' => $action],
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     protected function resolveAction(array $matches): string
50 50
     {
51 51
         $action = $this->action;
52
-        if (\is_string($action)) {
52
+        if (\is_string($action)){
53 53
             return $action;
54 54
         }
55 55
 
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,13 +26,16 @@  discard block
 block discarded – undo
26 26
         private readonly string|array $action,
27 27
         int $options = 0
28 28
     ) {
29
-        if (\is_string($action)) {
29
+        if (\is_string($action))
30
+        {
30 31
             parent::__construct(
31 32
                 ['action' => $action],
32 33
                 ['action' => new Autofill($action)],
33 34
                 $options
34 35
             );
35
-        } else {
36
+        }
37
+        else
38
+        {
36 39
             parent::__construct(
37 40
                 ['action' => null],
38 41
                 ['action' => $action],
@@ -49,7 +52,8 @@  discard block
 block discarded – undo
49 52
     protected function resolveAction(array $matches): string
50 53
     {
51 54
         $action = $this->action;
52
-        if (\is_string($action)) {
55
+        if (\is_string($action))
56
+        {
53 57
             return $action;
54 58
         }
55 59
 
Please login to merge, or discard this patch.