@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $scheme = array_shift($classPath); |
| 59 | 59 | assert(is_string($scheme)); |
| 60 | 60 | |
| 61 | - return strtolower("{$scheme}://self/" . implode('/', $classPath)); |
|
| 61 | + return strtolower("{$scheme}://self/".implode('/', $classPath)); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | private function getOptions(string $class): Options |
| 70 | 70 | { |
| 71 | - if (! class_exists($class)) { |
|
| 71 | + if (!class_exists($class)) { |
|
| 72 | 72 | throw new LogicException(); // @codeCoverageIgnore |
| 73 | 73 | } |
| 74 | 74 | |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | $allows = []; |
| 94 | 94 | foreach ($methods as $method) { |
| 95 | - $isRequestMethod = str_starts_with($method->name, 'on') && ! str_starts_with($method->name, 'onLink'); |
|
| 96 | - if (! $isRequestMethod) { |
|
| 95 | + $isRequestMethod = str_starts_with($method->name, 'on') && !str_starts_with($method->name, 'onLink'); |
|
| 96 | + if (!$isRequestMethod) { |
|
| 97 | 97 | continue; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | /** @param ResourceClassName $class */ |
| 107 | 107 | private function getParams(string $class, string $method): Params |
| 108 | 108 | { |
| 109 | - $refMethod = new ReflectionMethod($class, 'on' . $method); |
|
| 109 | + $refMethod = new ReflectionMethod($class, 'on'.$method); |
|
| 110 | 110 | $parameters = $refMethod->getParameters(); |
| 111 | 111 | $optionalParams = $requiredParams = []; |
| 112 | 112 | foreach ($parameters as $parameter) { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * |
| 39 | 39 | * @psalm-suppress RedundantCondition for BC |
| 40 | 40 | */ |
| 41 | - private function getParameterType(ReflectionParameter $parameter, array $paramDoc, string $name): string|null |
|
| 41 | + private function getParameterType(ReflectionParameter $parameter, array $paramDoc, string $name): string | null |
|
| 42 | 42 | { |
| 43 | 43 | /** @phpstan-ignore function.alreadyNarrowedType */ |
| 44 | 44 | $hasType = method_exists($parameter, 'getType') && $parameter->getType(); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $paramDoc[$name]['in'] = $ins[$parameter->name]; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - if (! isset($paramDoc[$parameter->name])) { |
|
| 67 | + if (!isset($paramDoc[$parameter->name])) { |
|
| 68 | 68 | $paramDoc[$name] = []; |
| 69 | 69 | } |
| 70 | 70 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $method = new ReflectionMethod($callable[0], $callable[1]); // @phpstan-ignore-line |
| 40 | 40 | $paramMetas = $this->getAttributeParamMetas($method); |
| 41 | 41 | |
| 42 | - if (! $paramMetas) { |
|
| 42 | + if (!$paramMetas) { |
|
| 43 | 43 | $paramMetas = $this->getAnnotationParamMetas($method); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $names[$annotation->param] = new AssistedResourceParam($annotation); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - if (! ($annotation instanceof Assisted)) { |
|
| 124 | + if (!($annotation instanceof Assisted)) { |
|
| 125 | 125 | continue; |
| 126 | 126 | } |
| 127 | 127 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | { |
| 143 | 143 | $webcontext = []; |
| 144 | 144 | foreach ($annotations as $annotation) { |
| 145 | - if (! ($annotation instanceof AbstractWebContextParam)) { |
|
| 145 | + if (!($annotation instanceof AbstractWebContextParam)) { |
|
| 146 | 146 | continue; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /** @psalm-return DefaultParam<mixed>|NoDefaultParam */ |
| 221 | - private function getDefault(ReflectionParameter $parameter): DefaultParam|NoDefaultParam |
|
| 221 | + private function getDefault(ReflectionParameter $parameter): DefaultParam | NoDefaultParam |
|
| 222 | 222 | { |
| 223 | 223 | return $parameter->isDefaultValueAvailable() === true ? new DefaultParam($parameter->getDefaultValue()) : new NoDefaultParam(); |
| 224 | 224 | } |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | private function getParam(ReflectionParameter $parameter): ParamInterface |
| 249 | 249 | { |
| 250 | 250 | $type = $parameter->getType(); |
| 251 | - if ($type instanceof ReflectionNamedType && ! $type->isBuiltin()) { |
|
| 251 | + if ($type instanceof ReflectionNamedType && !$type->isBuiltin()) { |
|
| 252 | 252 | return new ClassParam($type, $parameter); |
| 253 | 253 | } |
| 254 | 254 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function addHalLink(array $body, array $methodAnnotations, Hal $hal): Hal |
| 37 | 37 | { |
| 38 | - if (! empty($methodAnnotations)) { |
|
| 38 | + if (!empty($methodAnnotations)) { |
|
| 39 | 39 | $hal = $this->linkAnnotation($body, $methodAnnotations, $hal); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | private function linkAnnotation(array $body, array $methodAnnotations, Hal $hal): Hal |
| 55 | 55 | { |
| 56 | 56 | foreach ($methodAnnotations as $annotation) { |
| 57 | - if (! $annotation instanceof Link) { |
|
| 57 | + if (!$annotation instanceof Link) { |
|
| 58 | 58 | continue; |
| 59 | 59 | } |
| 60 | 60 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | private function bodyLink(array $body, Hal $hal): Hal |
| 81 | 81 | { |
| 82 | 82 | foreach ($body['_links'] as $rel => $link) { |
| 83 | - if (! isset($link['href'])) { |
|
| 83 | + if (!isset($link['href'])) { |
|
| 84 | 84 | // @codeCoverageIgnoreStart |
| 85 | 85 | continue; |
| 86 | 86 | // @codeCoverageIgnoreEnd |