@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | array_shift($classPath); // "/Resource/" |
| 51 | 51 | $scheme = array_shift($classPath); |
| 52 | 52 | |
| 53 | - return strtolower("{$scheme}://self/" . implode('/', $classPath)); |
|
| 53 | + return strtolower("{$scheme}://self/".implode('/', $classPath)); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | private function getOptions(string $class): Options |
| 62 | 62 | { |
| 63 | - if (! class_exists($class)) { |
|
| 63 | + if (!class_exists($class)) { |
|
| 64 | 64 | throw new LogicException(); // @codeCoverageIgnore |
| 65 | 65 | } |
| 66 | 66 | |
@@ -84,8 +84,8 @@ discard block |
||
| 84 | 84 | { |
| 85 | 85 | $allows = []; |
| 86 | 86 | foreach ($methods as $method) { |
| 87 | - $isRequestMethod = str_starts_with($method->name, 'on') && ! str_starts_with($method->name, 'onLink'); |
|
| 88 | - if (! $isRequestMethod) { |
|
| 87 | + $isRequestMethod = str_starts_with($method->name, 'on') && !str_starts_with($method->name, 'onLink'); |
|
| 88 | + if (!$isRequestMethod) { |
|
| 89 | 89 | continue; |
| 90 | 90 | } |
| 91 | 91 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | /** @param ResourceClassName $class */ |
| 99 | 99 | private function getParams(string $class, string $method): Params |
| 100 | 100 | { |
| 101 | - $refMethod = new ReflectionMethod($class, 'on' . $method); |
|
| 101 | + $refMethod = new ReflectionMethod($class, 'on'.$method); |
|
| 102 | 102 | $parameters = $refMethod->getParameters(); |
| 103 | 103 | $optionalParams = $requiredParams = []; |
| 104 | 104 | foreach ($parameters as $parameter) { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | private readonly JsonSchemaExceptionHandlerInterface $handler, |
| 45 | 45 | private readonly JsonSchemaRequestExceptionHandlerInterface $requestHandler, |
| 46 | 46 | #[Named('json_schema_host')] |
| 47 | - private readonly string|null $schemaHost = null, |
|
| 47 | + private readonly string | null $schemaHost = null, |
|
| 48 | 48 | ) { |
| 49 | 49 | } |
| 50 | 50 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | private function validateRequest(MethodInvocation $invocation, JsonSchema $jsonSchema, array $arguments): void |
| 76 | 76 | { |
| 77 | 77 | try { |
| 78 | - $schemaFile = $this->validateDir . '/' . $jsonSchema->params; |
|
| 78 | + $schemaFile = $this->validateDir.'/'.$jsonSchema->params; |
|
| 79 | 79 | $this->validateFileExists($schemaFile); |
| 80 | 80 | $this->validate($arguments, $schemaFile); |
| 81 | 81 | } catch (JsonSchemaException $e) { |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | return $json; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - if (! property_exists($json, $jsonSchema->key)) { |
|
| 118 | + if (!property_exists($json, $jsonSchema->key)) { |
|
| 119 | 119 | throw new JsonSchemaKeytNotFoundException($jsonSchema->key); |
| 120 | 120 | } |
| 121 | 121 | |
@@ -123,10 +123,10 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** @param array<mixed>|stdClass $target */ |
| 126 | - private function validate(array|stdClass $target, string $schemaFile): void |
|
| 126 | + private function validate(array | stdClass $target, string $schemaFile): void |
|
| 127 | 127 | { |
| 128 | 128 | $validator = new Validator(); |
| 129 | - $schema = (object) ['$ref' => 'file://' . $schemaFile]; |
|
| 129 | + $schema = (object) ['$ref' => 'file://'.$schemaFile]; |
|
| 130 | 130 | $scanArray = is_array($target) ? $target : $this->deepArray($target); |
| 131 | 131 | $validator->validate($scanArray, $schema, Constraint::CHECK_MODE_TYPE_CAST); |
| 132 | 132 | $isValid = $validator->isValid(); |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | private function getSchemaFile(JsonSchema $jsonSchema, ResourceObject $ro): string |
| 168 | 168 | { |
| 169 | - if (! $jsonSchema->schema) { |
|
| 169 | + if (!$jsonSchema->schema) { |
|
| 170 | 170 | // for BC only |
| 171 | 171 | new ReflectionClass($ro); |
| 172 | 172 | $roFileName = $this->getParentClassName($ro); |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - $schemaFile = $this->schemaDir . '/' . $jsonSchema->schema; |
|
| 179 | + $schemaFile = $this->schemaDir.'/'.$jsonSchema->schema; |
|
| 180 | 180 | $this->validateFileExists($schemaFile); |
| 181 | 181 | |
| 182 | 182 | return $schemaFile; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | private function validateFileExists(string $schemaFile): void |
| 193 | 193 | { |
| 194 | - if (! file_exists($schemaFile) || is_dir($schemaFile)) { |
|
| 194 | + if (!file_exists($schemaFile) || is_dir($schemaFile)) { |
|
| 195 | 195 | throw new JsonSchemaNotFoundException($schemaFile); |
| 196 | 196 | } |
| 197 | 197 | } |