Passed
Pull Request — 1.x (#336)
by Akihito
03:54 queued 01:21
created
src/Meta.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
src/JsonSchema/Interceptor/JsonSchemaInterceptor.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.