@@ -23,7 +23,7 @@ |
||
23 | 23 | * Run a set of guards. |
24 | 24 | */ |
25 | 25 | public function guard( |
26 | - \ReflectionObject|\ReflectionMethod $subject, |
|
26 | + \ReflectionObject | \ReflectionMethod $subject, |
|
27 | 27 | ServerRequestInterface $request, |
28 | 28 | ResponseInterface $response, |
29 | 29 | ): ?ResponseInterface { |
@@ -19,7 +19,7 @@ |
||
19 | 19 | return $this->guardian; |
20 | 20 | } |
21 | 21 | |
22 | - protected function guard(\ReflectionObject|\ReflectionMethod $subject): ?ResponseInterface |
|
22 | + protected function guard(\ReflectionObject | \ReflectionMethod $subject): ?ResponseInterface |
|
23 | 23 | { |
24 | 24 | return $this->getGuardian()->guard($subject, $this->getRequest(), $this->getResponse()); |
25 | 25 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $response = $this->createMock(ResponseInterface::class); |
44 | 44 | $response->method('getBody')->willReturn($stream); |
45 | 45 | $response->expects($this->once())->method('withHeader') |
46 | - ->with( 'Content-Type', $contentType) |
|
46 | + ->with('Content-Type', $contentType) |
|
47 | 47 | ->willReturnSelf(); |
48 | 48 | |
49 | 49 | $controller = $this->createPartialMock(Controller::class, ['getResponse']); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $response = $this->createMock(ResponseInterface::class); |
100 | 100 | $response->method('getBody')->willReturn($stream); |
101 | 101 | $response->expects($this->once())->method('withHeader') |
102 | - ->with( 'Content-Type', 'application/json') |
|
102 | + ->with('Content-Type', 'application/json') |
|
103 | 103 | ->willReturnSelf(); |
104 | 104 | |
105 | 105 | $controller = $this->createPartialMock(Controller::class, ['getResponse']); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * @dataProvider statusProvider |
29 | 29 | */ |
30 | - public function testStatus(int|string $status, int $code, string $phrase) |
|
30 | + public function testStatus(int | string $status, int $code, string $phrase) |
|
31 | 31 | { |
32 | 32 | $response = $this->createMock(ResponseInterface::class); |
33 | 33 | $response->expects($this->once())->method('withStatus')->with($code, $phrase)->willReturnSelf(); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | * Test 'redirect' function |
206 | 206 | * @dataProvider redirectStatusProvider |
207 | 207 | */ |
208 | - public function testRedirect(int|string $status) |
|
208 | + public function testRedirect(int | string $status) |
|
209 | 209 | { |
210 | 210 | $controller = $this->createPartialMock(Controller::class, ['status', 'header', 'output']); |
211 | 211 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | abstract protected function getRequest(): ServerRequestInterface; |
16 | 16 | abstract protected function getResponse(): ResponseInterface; |
17 | 17 | |
18 | - abstract protected function header(string $header, string|int|\Stringable $value, bool $add = false): static; |
|
18 | + abstract protected function header(string $header, string | int | \Stringable $value, bool $add = false): static; |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * Pick the best content type |
@@ -97,7 +97,7 @@ |
||
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
100 | - protected function getBody(ResponseInterface $response): string|null |
|
100 | + protected function getBody(ResponseInterface $response): string | null |
|
101 | 101 | { |
102 | 102 | $body = (string)$response->getBody(); |
103 | 103 | return $body !== '' ? $body : null; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @return $this |
26 | 26 | */ |
27 | - protected function header(string $header, string|int|\Stringable $value, bool $add = false): static |
|
27 | + protected function header(string $header, string | int | \Stringable $value, bool $add = false): static |
|
28 | 28 | { |
29 | 29 | $response = $add |
30 | 30 | ? $this->getResponse()->withAddedHeader($header, (string)$value) |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @param int|string $status |
48 | 48 | * @return $this |
49 | 49 | */ |
50 | - protected function status(int|string $status): static |
|
50 | + protected function status(int | string $status): static |
|
51 | 51 | { |
52 | 52 | if (is_string($status)) { |
53 | 53 | [$status, $phrase] = explode(' ', $status, 2) + [1 => '']; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @param int|string $status 301 (Moved Permanently), 302 (Found), 303 (See Other) or 307 (Temporary Redirect) |
136 | 136 | * @return $this |
137 | 137 | */ |
138 | - protected function redirect(string $url, int|string $status = 303): static |
|
138 | + protected function redirect(string $url, int | string $status = 303): static |
|
139 | 139 | { |
140 | 140 | if ($status < 300 || $status >= 400) { |
141 | 141 | throw new \DomainException("Invalid status code $status for redirect"); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | trait Twig |
14 | 14 | { |
15 | - private JasnyTwig|SlimTwig $twig; |
|
15 | + private JasnyTwig | SlimTwig $twig; |
|
16 | 16 | |
17 | 17 | abstract protected function getResponse(): ResponseInterface; |
18 | 18 |