Passed
Pull Request — master (#829)
by
unknown
06:46
created
src/Router/tests/Loader/Configurator/RoutingConfiguratorTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
         $this->assertCount(0, $routes->getCollection());
19 19
 
20
-        $routes->import(\dirname(__DIR__, 2) . '/Fixtures/file.php');
20
+        $routes->import(\dirname(__DIR__, 2).'/Fixtures/file.php');
21 21
 
22 22
         $this->assertCount(3, $routes->getCollection());
23 23
     }
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
         $this->assertCount(0, $routes->getCollection());
30 30
 
31
-        $routes->import(\dirname(__DIR__, 2) . '/Fixtures/file.php', 'php');
31
+        $routes->import(\dirname(__DIR__, 2).'/Fixtures/file.php', 'php');
32 32
 
33 33
         $this->assertCount(3, $routes->getCollection());
34 34
     }
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
         $this->assertCount(0, $routes->getCollection());
41 41
 
42
-        $routes->import(\dirname(__DIR__, 2) . '/Fixtures/file.php', 'yaml');
42
+        $routes->import(\dirname(__DIR__, 2).'/Fixtures/file.php', 'yaml');
43 43
 
44 44
         $this->assertCount(0, $routes->getCollection());
45 45
     }
Please login to merge, or discard this patch.
src/Router/tests/PipelineFactoryTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
             new Autowire('bar'),
72 72
         ]));
73 73
 
74
-        $handle = function (ServerRequestInterface $request, RequestHandlerInterface $handler) {
74
+        $handle = function (ServerRequestInterface $request, RequestHandlerInterface $handler){
75 75
             return $handler->handle($request);
76 76
         };
77 77
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,8 @@
 block discarded – undo
71 71
             new Autowire('bar'),
72 72
         ]));
73 73
 
74
-        $handle = function (ServerRequestInterface $request, RequestHandlerInterface $handler) {
74
+        $handle = function (ServerRequestInterface $request, RequestHandlerInterface $handler)
75
+        {
75 76
             return $handler->handle($request);
76 77
         };
77 78
 
Please login to merge, or discard this patch.
src/Router/tests/UriTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
             ]))
101 101
         );
102 102
 
103
-        $uri = $router->uri('test:id', ['id' => 100, 'title' => new class implements \Stringable {
103
+        $uri = $router->uri('test:id', ['id' => 100, 'title' => new class implements \Stringable{
104 104
             public function __toString()
105 105
             {
106 106
                 return 'hello-world';
Please login to merge, or discard this patch.
src/Router/tests/TestCore.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,6 +17,6 @@
 block discarded – undo
17 17
 
18 18
     public function callAction(string $controller, string $action = null, array $parameters = []): string
19 19
     {
20
-        return '@wrapped.' . $this->core->callAction($controller, $action, $parameters);
20
+        return '@wrapped.'.$this->core->callAction($controller, $action, $parameters);
21 21
     }
22 22
 }
Please login to merge, or discard this patch.
src/Router/tests/Fixtures/file.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 use Spiral\Router\Loader\Configurator\RoutingConfigurator;
4 4
 
5
-return function (RoutingConfigurator $routes) {
5
+return function (RoutingConfigurator $routes){
6 6
     $routes->add('index', '/')->callable(static fn () => null);
7 7
     $routes->add('posts', '/posts')->callable(static fn () => null);
8 8
     $routes->add('post', '/post/<id>')->callable(static fn () => null);
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,8 @@
 block discarded – undo
2 2
 
3 3
 use Spiral\Router\Loader\Configurator\RoutingConfigurator;
4 4
 
5
-return function (RoutingConfigurator $routes) {
5
+return function (RoutingConfigurator $routes)
6
+{
6 7
     $routes->add('index', '/')->callable(static fn () => null);
7 8
     $routes->add('posts', '/posts')->callable(static fn () => null);
8 9
     $routes->add('post', '/post/<id>')->callable(static fn () => null);
Please login to merge, or discard this patch.
src/Router/tests/SingleActionTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,9 +96,9 @@
 block discarded – undo
96 96
         $this->assertSame('echoed', (string)$response->getBody());
97 97
 
98 98
         $e = null;
99
-        try {
99
+        try{
100 100
             $router->handle(new ServerRequest('GET', new Uri('/test')));
101
-        } catch (UndefinedRouteException $e) {
101
+        }catch (UndefinedRouteException $e){
102 102
         }
103 103
 
104 104
         $this->assertNotNull($e, 'Autofill not fired');
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,9 +96,12 @@
 block discarded – undo
96 96
         $this->assertSame('echoed', (string)$response->getBody());
97 97
 
98 98
         $e = null;
99
-        try {
99
+        try
100
+        {
100 101
             $router->handle(new ServerRequest('GET', new Uri('/test')));
101
-        } catch (UndefinedRouteException $e) {
102
+        }
103
+        catch (UndefinedRouteException $e)
104
+        {
102 105
         }
103 106
 
104 107
         $this->assertNotNull($e, 'Autofill not fired');
Please login to merge, or discard this patch.
src/Router/tests/RouterTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
         $dispatcher
51 51
             ->expects(self::exactly(2))
52 52
             ->method('dispatch')
53
-            ->with($this->callback(static fn (Routing|RouteMatched $event): bool => $event->request instanceof ServerRequest));
53
+            ->with($this->callback(static fn (Routing | RouteMatched $event): bool => $event->request instanceof ServerRequest));
54 54
 
55 55
         $router = $this->makeRouter('', $dispatcher);
56 56
         $router->setDefault($route);
Please login to merge, or discard this patch.
src/Router/tests/Diactoros/ResponseFactory.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
         $response = new Response($code);
34 34
         $response = $response->withStatus($code, $reasonPhrase);
35 35
 
36
-        foreach ($this->config->getBaseHeaders() as $header => $value) {
36
+        foreach ($this->config->getBaseHeaders() as $header => $value){
37 37
             $response = $response->withAddedHeader($header, $value);
38 38
         }
39 39
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@
 block discarded – undo
33 33
         $response = new Response($code);
34 34
         $response = $response->withStatus($code, $reasonPhrase);
35 35
 
36
-        foreach ($this->config->getBaseHeaders() as $header => $value) {
36
+        foreach ($this->config->getBaseHeaders() as $header => $value)
37
+        {
37 38
             $response = $response->withAddedHeader($header, $value);
38 39
         }
39 40
 
Please login to merge, or discard this patch.
src/Router/src/Loader/Configurator/ImportConfigurator.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     public function __construct(
14 14
         private readonly RouteCollection $parent,
15 15
         private readonly RouteCollection $routes
16
-    ) {
16
+    ){
17 17
     }
18 18
 
19 19
     public function __destruct()
@@ -23,17 +23,17 @@  discard block
 block discarded – undo
23 23
 
24 24
     public function __sleep(): array
25 25
     {
26
-        throw new \BadMethodCallException('Cannot unserialize ' . self::class);
26
+        throw new \BadMethodCallException('Cannot unserialize '.self::class);
27 27
     }
28 28
 
29 29
     public function __wakeup()
30 30
     {
31
-        throw new \BadMethodCallException('Cannot unserialize ' . self::class);
31
+        throw new \BadMethodCallException('Cannot unserialize '.self::class);
32 32
     }
33 33
 
34 34
     public function defaults(array $defaults): self
35 35
     {
36
-        foreach ($this->routes->all() as $configurator) {
36
+        foreach ($this->routes->all() as $configurator){
37 37
             $configurator->defaults($defaults);
38 38
         }
39 39
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function group(string $group): self
44 44
     {
45
-        foreach ($this->routes->all() as $configurator) {
45
+        foreach ($this->routes->all() as $configurator){
46 46
             $configurator->group($group);
47 47
         }
48 48
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
     public function prefix(string $prefix): self
53 53
     {
54
-        foreach ($this->routes->all() as $configurator) {
54
+        foreach ($this->routes->all() as $configurator){
55 55
             $configurator->prefix($prefix);
56 56
         }
57 57
 
@@ -60,16 +60,16 @@  discard block
 block discarded – undo
60 60
 
61 61
     public function core(CoreInterface $core): self
62 62
     {
63
-        foreach ($this->routes->all() as $configurator) {
63
+        foreach ($this->routes->all() as $configurator){
64 64
             $configurator->core($core);
65 65
         }
66 66
 
67 67
         return $this;
68 68
     }
69 69
 
70
-    public function middleware(MiddlewareInterface|string|array $middleware): self
70
+    public function middleware(MiddlewareInterface | string | array $middleware): self
71 71
     {
72
-        foreach ($this->routes->all() as $configurator) {
72
+        foreach ($this->routes->all() as $configurator){
73 73
             $configurator->middleware($middleware);
74 74
         }
75 75
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@  discard block
 block discarded – undo
33 33
 
34 34
     public function defaults(array $defaults): self
35 35
     {
36
-        foreach ($this->routes->all() as $configurator) {
36
+        foreach ($this->routes->all() as $configurator)
37
+        {
37 38
             $configurator->defaults($defaults);
38 39
         }
39 40
 
@@ -42,7 +43,8 @@  discard block
 block discarded – undo
42 43
 
43 44
     public function group(string $group): self
44 45
     {
45
-        foreach ($this->routes->all() as $configurator) {
46
+        foreach ($this->routes->all() as $configurator)
47
+        {
46 48
             $configurator->group($group);
47 49
         }
48 50
 
@@ -51,7 +53,8 @@  discard block
 block discarded – undo
51 53
 
52 54
     public function prefix(string $prefix): self
53 55
     {
54
-        foreach ($this->routes->all() as $configurator) {
56
+        foreach ($this->routes->all() as $configurator)
57
+        {
55 58
             $configurator->prefix($prefix);
56 59
         }
57 60
 
@@ -60,7 +63,8 @@  discard block
 block discarded – undo
60 63
 
61 64
     public function core(CoreInterface $core): self
62 65
     {
63
-        foreach ($this->routes->all() as $configurator) {
66
+        foreach ($this->routes->all() as $configurator)
67
+        {
64 68
             $configurator->core($core);
65 69
         }
66 70
 
@@ -69,7 +73,8 @@  discard block
 block discarded – undo
69 73
 
70 74
     public function middleware(MiddlewareInterface|string|array $middleware): self
71 75
     {
72
-        foreach ($this->routes->all() as $configurator) {
76
+        foreach ($this->routes->all() as $configurator)
77
+        {
73 78
             $configurator->middleware($middleware);
74 79
         }
75 80
 
Please login to merge, or discard this patch.