Test Failed
Pull Request — master (#1163)
by Abdul Malik
10:57
created
src/Router/tests/Loader/PhpFileLoaderTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@
 block discarded – undo
29 29
     {
30 30
         $loader = new PhpFileLoader($this->container, $this->container);
31 31
 
32
-        $routes = $loader->load(\dirname(__DIR__) . '/Fixtures/file.php');
32
+        $routes = $loader->load(\dirname(__DIR__).'/Fixtures/file.php');
33 33
         $this->assertInstanceOf(RouteCollection::class, $routes);
34 34
         $this->assertCount(3, $routes);
35 35
 
36 36
         $this->expectException(LoaderLoadException::class);
37
-        $loader->load(\dirname(__DIR__) . '/Fixtures/unknown.php');
37
+        $loader->load(\dirname(__DIR__).'/Fixtures/unknown.php');
38 38
     }
39 39
 
40 40
     public function testSupports(): void
Please login to merge, or discard this patch.
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/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/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/RoutingConfigurator.php 2 patches
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.
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.
src/Router/src/Loader/LoaderRegistryInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,5 +11,5 @@
 block discarded – undo
11 11
      *
12 12
      * @param string|null $type The resource type or null if unknown
13 13
      */
14
-    public function resolve(mixed $resource, string $type = null): LoaderInterface|false;
14
+    public function resolve(mixed $resource, string $type = null): LoaderInterface | false;
15 15
 }
Please login to merge, or discard this patch.
src/Router/src/Loader/LoaderRegistry.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,15 +16,15 @@
 block discarded – undo
16 16
      */
17 17
     public function __construct(array $loaders = [])
18 18
     {
19
-        foreach ($loaders as $loader) {
19
+        foreach ($loaders as $loader){
20 20
             $this->addLoader($loader);
21 21
         }
22 22
     }
23 23
 
24
-    public function resolve(mixed $resource, string $type = null): LoaderInterface|false
24
+    public function resolve(mixed $resource, string $type = null): LoaderInterface | false
25 25
     {
26
-        foreach ($this->loaders as $loader) {
27
-            if ($loader->supports($resource, $type)) {
26
+        foreach ($this->loaders as $loader){
27
+            if ($loader->supports($resource, $type)){
28 28
                 return $loader;
29 29
             }
30 30
         }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,15 +16,18 @@
 block discarded – undo
16 16
      */
17 17
     public function __construct(array $loaders = [])
18 18
     {
19
-        foreach ($loaders as $loader) {
19
+        foreach ($loaders as $loader)
20
+        {
20 21
             $this->addLoader($loader);
21 22
         }
22 23
     }
23 24
 
24 25
     public function resolve(mixed $resource, string $type = null): LoaderInterface|false
25 26
     {
26
-        foreach ($this->loaders as $loader) {
27
-            if ($loader->supports($resource, $type)) {
27
+        foreach ($this->loaders as $loader)
28
+        {
29
+            if ($loader->supports($resource, $type))
30
+            {
28 31
                 return $loader;
29 32
             }
30 33
         }
Please login to merge, or discard this patch.