@@ -29,12 +29,12 @@ |
||
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 |
@@ -17,7 +17,7 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -71,7 +71,7 @@ |
||
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 |
@@ -71,7 +71,8 @@ |
||
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 |
@@ -100,7 +100,7 @@ |
||
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'; |
@@ -17,6 +17,6 @@ |
||
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 | } |
@@ -2,7 +2,7 @@ |
||
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); |
@@ -2,7 +2,8 @@ |
||
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); |
@@ -96,9 +96,9 @@ |
||
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'); |
@@ -96,9 +96,12 @@ |
||
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'); |
@@ -50,7 +50,7 @@ |
||
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); |
@@ -33,7 +33,7 @@ |
||
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 |
@@ -33,7 +33,8 @@ |
||
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 |