We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | /** |
63 | 63 | * @throws ArgumentsValidationException |
64 | 64 | */ |
65 | - public function validate(string|array|null $groups = null, bool $throw = true): ?ConstraintViolationListInterface |
|
65 | + public function validate(string | array | null $groups = null, bool $throw = true): ?ConstraintViolationListInterface |
|
66 | 66 | { |
67 | 67 | $rootNode = new ValidationNode( |
68 | 68 | $this->info->parentType, |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | return $rootObject; |
207 | 207 | } |
208 | 208 | |
209 | - private static function isListOfType(GeneratedTypeInterface|ListOfType|NonNull $type): bool |
|
209 | + private static function isListOfType(GeneratedTypeInterface | ListOfType | NonNull $type): bool |
|
210 | 210 | { |
211 | 211 | if ($type instanceof ListOfType || ($type instanceof NonNull && $type->getWrappedType() instanceof ListOfType)) { |
212 | 212 | return true; |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | return false; |
216 | 216 | } |
217 | 217 | |
218 | - private function createCollectionNode(array $values, ObjectType|InputObjectType $type, ValidationNode $parent): array |
|
218 | + private function createCollectionNode(array $values, ObjectType | InputObjectType $type, ValidationNode $parent): array |
|
219 | 219 | { |
220 | 220 | $collection = []; |
221 | 221 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | return $collection; |
227 | 227 | } |
228 | 228 | |
229 | - private function createObjectNode(array $value, ObjectType|InputObjectType $type, ValidationNode $parent): ValidationNode |
|
229 | + private function createObjectNode(array $value, ObjectType | InputObjectType $type, ValidationNode $parent): ValidationNode |
|
230 | 230 | { |
231 | 231 | /** @phpstan-ignore-next-line */ |
232 | 232 | $classValidation = static::normalizeConfig($type->config['validation'] ?? []); |
@@ -18,8 +18,8 @@ |
||
18 | 18 | protected function getResolverSolutionsMapping(): array |
19 | 19 | { |
20 | 20 | return [ |
21 | - 'Toto' => ['factory' => fn () => new ObjectType(['name' => 'Toto', 'fields' => []]), 'aliases' => ['foo']], |
|
22 | - 'Tata' => ['factory' => fn () => new ObjectType(['name' => 'Tata', 'fields' => []]), 'aliases' => ['bar']], |
|
21 | + 'Toto' => ['factory' => fn() => new ObjectType(['name' => 'Toto', 'fields' => []]), 'aliases' => ['foo']], |
|
22 | + 'Tata' => ['factory' => fn() => new ObjectType(['name' => 'Tata', 'fields' => []]), 'aliases' => ['bar']], |
|
23 | 23 | ]; |
24 | 24 | } |
25 | 25 |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @dataProvider specialTypeFieldProvider |
34 | 34 | */ |
35 | - public function testSpecialField($fieldName, ObjectType|UnionType|InterfaceType|CustomScalarType $typeWithSpecialField, callable $fieldValueRetriever = null, $strict = true): void |
|
35 | + public function testSpecialField($fieldName, ObjectType | UnionType | InterfaceType | CustomScalarType $typeWithSpecialField, callable $fieldValueRetriever = null, $strict = true): void |
|
36 | 36 | { |
37 | 37 | if (null === $fieldValueRetriever) { |
38 | - $fieldValueRetriever = fn (ObjectType|UnionType|InterfaceType|CustomScalarType $type, $fieldName) => $type->config[$fieldName]; |
|
38 | + $fieldValueRetriever = fn(ObjectType | UnionType | InterfaceType | CustomScalarType $type, $fieldName) => $type->config[$fieldName]; |
|
39 | 39 | } |
40 | 40 | $expected = static function (): void { |
41 | 41 | }; |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | ]; |
69 | 69 | }, |
70 | 70 | ]); |
71 | - $barResolver = static fn () => 'bar'; |
|
72 | - $bazResolver = static fn () => 'baz'; |
|
71 | + $barResolver = static fn() => 'bar'; |
|
72 | + $bazResolver = static fn() => 'baz'; |
|
73 | 73 | |
74 | 74 | $this->decorate( |
75 | 75 | [$objectType->name => $objectType], |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | [$objectType->name => $objectType], |
105 | 105 | [ |
106 | 106 | $objectType->name => [ |
107 | - 'bar' => fn ($value, $args) => $args, |
|
107 | + 'bar' => fn($value, $args) => $args, |
|
108 | 108 | ], |
109 | 109 | ] |
110 | 110 | ); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | |
194 | 194 | public function testCustomScalarTypeUnknownField(): void |
195 | 195 | { |
196 | - $customScalarType = new CustomScalarType(['name' => 'Foo', 'scalarType' => Type::string(), 'serialize' => fn (mixed $input): mixed => '']); |
|
196 | + $customScalarType = new CustomScalarType(['name' => 'Foo', 'scalarType' => Type::string(), 'serialize' => fn(mixed $input): mixed => '']); |
|
197 | 197 | $this->assertDecorateException( |
198 | 198 | [$customScalarType->name => $customScalarType], |
199 | 199 | [ |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | public function specialTypeFieldProvider(): array |
247 | 247 | { |
248 | - $objectWithResolveField = new ObjectType(['name' => 'Bar', 'fields' => [], 'resolveField' => fn () => '']); |
|
248 | + $objectWithResolveField = new ObjectType(['name' => 'Bar', 'fields' => [], 'resolveField' => fn() => '']); |
|
249 | 249 | |
250 | 250 | return [ |
251 | 251 | // isTypeOf |
@@ -254,18 +254,18 @@ discard block |
||
254 | 254 | [ |
255 | 255 | ResolverMapInterface::RESOLVE_FIELD, |
256 | 256 | $objectWithResolveField, |
257 | - fn (ObjectType $type) => $type->resolveFieldFn, |
|
257 | + fn(ObjectType $type) => $type->resolveFieldFn, |
|
258 | 258 | false, |
259 | 259 | ], |
260 | 260 | [ResolverMapInterface::RESOLVE_FIELD, $objectWithResolveField, null, false], |
261 | 261 | // resolveType |
262 | - [ResolverMapInterface::RESOLVE_TYPE, new UnionType(['name' => 'Baz', 'resolveType' => fn () => '', 'types' => []])], |
|
263 | - [ResolverMapInterface::RESOLVE_TYPE, new InterfaceType(['name' => 'Baz', 'fields' => [], 'resolveType' => fn (mixed $objectValue, mixed $context, ResolveInfo $resolveInfo): string => ''])], |
|
262 | + [ResolverMapInterface::RESOLVE_TYPE, new UnionType(['name' => 'Baz', 'resolveType' => fn() => '', 'types' => []])], |
|
263 | + [ResolverMapInterface::RESOLVE_TYPE, new InterfaceType(['name' => 'Baz', 'fields' => [], 'resolveType' => fn(mixed $objectValue, mixed $context, ResolveInfo $resolveInfo): string => ''])], |
|
264 | 264 | // custom scalar |
265 | - [ResolverMapInterface::SERIALIZE, new CustomScalarType(['name' => 'Custom', 'scalarType' => Type::string(), 'serialize' => fn (mixed $input): mixed => ''])], |
|
266 | - [ResolverMapInterface::PARSE_VALUE, new CustomScalarType(['name' => 'Custom', 'scalarType' => Type::string(), 'serialize' => fn (mixed $input): mixed => '', 'parseValue' => fn (mixed $input): mixed => ''])], |
|
267 | - [ResolverMapInterface::PARSE_LITERAL, new CustomScalarType(['name' => 'Custom', 'scalarType' => Type::string(), 'serialize' => fn (mixed $input): mixed => '', 'parseLiteral' => fn (Node $a, array|null $b): mixed => ''])], |
|
268 | - [ResolverMapInterface::SCALAR_TYPE, new CustomScalarType(['name' => 'Custom', 'scalarType' => Type::string(), 'serialize' => fn (mixed $input): mixed => ''])], |
|
265 | + [ResolverMapInterface::SERIALIZE, new CustomScalarType(['name' => 'Custom', 'scalarType' => Type::string(), 'serialize' => fn(mixed $input): mixed => ''])], |
|
266 | + [ResolverMapInterface::PARSE_VALUE, new CustomScalarType(['name' => 'Custom', 'scalarType' => Type::string(), 'serialize' => fn(mixed $input): mixed => '', 'parseValue' => fn(mixed $input): mixed => ''])], |
|
267 | + [ResolverMapInterface::PARSE_LITERAL, new CustomScalarType(['name' => 'Custom', 'scalarType' => Type::string(), 'serialize' => fn(mixed $input): mixed => '', 'parseLiteral' => fn(Node $a, array | null $b): mixed => ''])], |
|
268 | + [ResolverMapInterface::SCALAR_TYPE, new CustomScalarType(['name' => 'Custom', 'scalarType' => Type::string(), 'serialize' => fn(mixed $input): mixed => ''])], |
|
269 | 269 | ]; |
270 | 270 | } |
271 | 271 |
@@ -22,12 +22,12 @@ discard block |
||
22 | 22 | public function testScalarTypeConfig(): void |
23 | 23 | { |
24 | 24 | $this->assertScalarTypeConfig(new YearScalarType()); |
25 | - $this->assertScalarTypeConfig(fn () => new YearScalarType()); |
|
25 | + $this->assertScalarTypeConfig(fn() => new YearScalarType()); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | public function testWithoutScalarTypeConfig(): void |
29 | 29 | { |
30 | - $genericFunc = fn ($value) => $value; |
|
30 | + $genericFunc = fn($value) => $value; |
|
31 | 31 | /** @phpstan-ignore-next-line */ |
32 | 32 | $type = new CustomScalarType([ |
33 | 33 | 'serialize' => $genericFunc, |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | ScalarType::class, |
58 | 58 | $got |
59 | 59 | )); |
60 | - $type = new CustomScalarType(['name' => $name, 'scalarType' => $scalarType, 'serialize' => fn (mixed $input): mixed => '']); |
|
60 | + $type = new CustomScalarType(['name' => $name, 'scalarType' => $scalarType, 'serialize' => fn(mixed $input): mixed => '']); |
|
61 | 61 | $type->assertValid(); |
62 | 62 | } |
63 | 63 | |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | yield [false, 'false']; |
67 | 67 | yield [new stdClass(), 'instance of stdClass']; |
68 | 68 | yield [ |
69 | - fn () => false, |
|
69 | + fn() => false, |
|
70 | 70 | 'false', |
71 | 71 | ]; |
72 | 72 | yield [ |
73 | - fn () => new stdClass(), |
|
73 | + fn() => new stdClass(), |
|
74 | 74 | 'instance of stdClass', |
75 | 75 | ]; |
76 | 76 | } |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | { |
85 | 85 | $type = new CustomScalarType([ |
86 | 86 | 'scalarType' => $scalarType, |
87 | - 'serialize' => fn () => 'serialize', |
|
88 | - 'parseValue' => fn () => 'parseValue', |
|
89 | - 'parseLiteral' => fn () => 'parseLiteral', |
|
87 | + 'serialize' => fn() => 'serialize', |
|
88 | + 'parseValue' => fn() => 'parseValue', |
|
89 | + 'parseLiteral' => fn() => 'parseLiteral', |
|
90 | 90 | ]); |
91 | 91 | |
92 | 92 | $this->assertSame('50 AC', $type->serialize(50)); |