@@ -10,7 +10,7 @@ |
||
| 10 | 10 | |
| 11 | 11 | class BadRequestException extends BadMethodCallException implements ExceptionInterface |
| 12 | 12 | { |
| 13 | - public function __construct(string $message = '', int $code = Code::BAD_REQUEST, Throwable|null $previous = null) |
|
| 13 | + public function __construct(string $message = '', int $code = Code::BAD_REQUEST, Throwable | null $previous = null) |
|
| 14 | 14 | { |
| 15 | 15 | parent::__construct($message, $code, $previous); |
| 16 | 16 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | ) { |
| 39 | 39 | $this->type = $type->getName(); |
| 40 | 40 | $this->isDefaultAvailable = $parameter->isDefaultValueAvailable(); |
| 41 | - if (! $this->isDefaultAvailable) { |
|
| 41 | + if (!$this->isDefaultAvailable) { |
|
| 42 | 42 | return; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -116,12 +116,12 @@ discard block |
||
| 116 | 116 | $refEnum = new ReflectionEnum($type); |
| 117 | 117 | assert(enum_exists($type)); |
| 118 | 118 | |
| 119 | - if (! $refEnum->isBacked()) { |
|
| 119 | + if (!$refEnum->isBacked()) { |
|
| 120 | 120 | throw new NotBackedEnumException($type); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | assert(is_a($type, BackedEnum::class, true)); |
| 124 | - if (! (is_int($props) || is_string($props))) { |
|
| 124 | + if (!(is_int($props) || is_string($props))) { |
|
| 125 | 125 | throw new ParameterEnumTypeException($varName); |
| 126 | 126 | } |
| 127 | 127 | |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | |
| 46 | 46 | $path = str_replace('-', '', ucwords($uri->path, '/-')); |
| 47 | 47 | /** @var ''|class-string $class */ |
| 48 | - $class = sprintf('%s\Resource\%s', $this->namespace, str_replace('/', '\\', ucwords($uri->scheme) . $path)); |
|
| 48 | + $class = sprintf('%s\Resource\%s', $this->namespace, str_replace('/', '\\', ucwords($uri->scheme).$path)); |
|
| 49 | 49 | try { |
| 50 | 50 | $instance = $this->injector->getInstance($class); |
| 51 | 51 | assert($instance instanceof ResourceObject); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | private function embedResource(array $embeds, ResourceObject $ro, array $query): void |
| 61 | 61 | { |
| 62 | 62 | foreach ($embeds as $embed) { |
| 63 | - if (! $embed instanceof Embed) { |
|
| 63 | + if (!$embed instanceof Embed) { |
|
| 64 | 64 | continue; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | private function getFullUri(string $uri, ResourceObject $ro): string |
| 91 | 91 | { |
| 92 | 92 | if ($uri[0] === '/') { |
| 93 | - $uri = "{$ro->uri->scheme}://{$ro->uri->host}" . $uri; |
|
| 93 | + $uri = "{$ro->uri->scheme}://{$ro->uri->host}".$uri; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | return $uri; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $ro->body = []; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - if (! is_array($ro->body)) { |
|
| 105 | + if (!is_array($ro->body)) { |
|
| 106 | 106 | throw new LinkException($embed->rel); // @codeCoverageIgnore |
| 107 | 107 | } |
| 108 | 108 | } |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | 'headers' => $this->headers, |
| 47 | 47 | 'body' => $this->body, |
| 48 | 48 | 'view' => $this->view, |
| 49 | - ] = $this->httpRequest->request($method, (string) $uri, $uri->query); |
|
| 49 | + ] = $this->httpRequest->request($method, (string) $uri, $uri->query); |
|
| 50 | 50 | |
| 51 | 51 | return $this; |
| 52 | 52 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | public function __invoke(string $varName, array $query, InjectorInterface $injector) |
| 33 | 33 | { |
| 34 | 34 | $type = $this->parameter->getType(); |
| 35 | - if ($type instanceof ReflectionNamedType && ! $type->isBuiltin()) { |
|
| 35 | + if ($type instanceof ReflectionNamedType && !$type->isBuiltin()) { |
|
| 36 | 36 | $inputClass = $type->getName(); |
| 37 | 37 | assert(class_exists($inputClass)); |
| 38 | 38 | |
@@ -15,6 +15,6 @@ |
||
| 15 | 15 | #[Override] |
| 16 | 16 | public function render(ResourceObject $ro): never |
| 17 | 17 | { |
| 18 | - throw new MethodNotAllowedException($ro::class . '::options', 405); |
|
| 18 | + throw new MethodNotAllowedException($ro::class.'::options', 405); |
|
| 19 | 19 | } |
| 20 | 20 | } |
@@ -35,6 +35,6 @@ |
||
| 35 | 35 | #[Override] |
| 36 | 36 | public function __toString() |
| 37 | 37 | { |
| 38 | - return "{$this->scheme}://{$this->host}{$this->path}" . ($this->query ? '?' . http_build_query($this->query) : ''); |
|
| 38 | + return "{$this->scheme}://{$this->host}{$this->path}".($this->query ? '?'.http_build_query($this->query) : ''); |
|
| 39 | 39 | } |
| 40 | 40 | } |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | #[\Override] |
| 26 | 26 | public function invoke(AbstractRequest $request): ResourceObject |
| 27 | 27 | { |
| 28 | - $callable = [$request->resourceObject, 'on' . ucfirst($request->method)]; |
|
| 29 | - if (! is_callable($callable)) { |
|
| 28 | + $callable = [$request->resourceObject, 'on'.ucfirst($request->method)]; |
|
| 29 | + if (!is_callable($callable)) { |
|
| 30 | 30 | // OPTIONS or HEAD |
| 31 | 31 | return ($this->extraMethod)($request, $this); |
| 32 | 32 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | throw $e; |
| 43 | 43 | } |
| 44 | - if (! $response instanceof ResourceObject) { |
|
| 44 | + if (!$response instanceof ResourceObject) { |
|
| 45 | 45 | $request->resourceObject->body = $response; |
| 46 | 46 | $response = $request->resourceObject; |
| 47 | 47 | } |