@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @param ?callable $errorCallable Optionally, a callback function may be given, to be |
26 | 26 | * called when ACCEPT header doesn't match any of the expected. |
27 | 27 | */ |
28 | - public function __construct(string $method, string $pattern, $callable, ?callable $errorCallable = null) |
|
28 | + public function __construct(string $method, string $pattern, $callable, ? callable $errorCallable = null) |
|
29 | 29 | { |
30 | 30 | if (!in_array($method, $this->allowedMethods)) { |
31 | 31 | throw new \Exception( |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | { |
63 | 63 | $callable = $this->callable; |
64 | 64 | $errorCallable = $this->errorCallable; |
65 | - $this->callable = function ( |
|
65 | + $this->callable = function( |
|
66 | 66 | RequestInterface $request, |
67 | 67 | Response $response, |
68 | 68 | array $args |
@@ -80,8 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | return null !== $errorCallable ? |
83 | - $errorCallable($response) : |
|
84 | - $response->withStatus(406) |
|
83 | + $errorCallable($response) : $response->withStatus(406) |
|
85 | 84 | ->write('API version not present or not accepted'); |
86 | 85 | }; |
87 | 86 | } |