@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | class ToInteger extends AbstractCollectionStrategy implements |
17 | 17 | StrategyInterface |
18 | 18 | { |
19 | - public function extract(mixed $value, object|null $object = null): mixed |
|
19 | + public function extract(mixed $value, object | null $object = null): mixed |
|
20 | 20 | { |
21 | 21 | if ($value === null) { |
22 | 22 | // @codeCoverageIgnoreStart |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @codeCoverageIgnore |
34 | 34 | */ |
35 | - public function hydrate(mixed $value, array|null $data): mixed |
|
35 | + public function hydrate(mixed $value, array | null $data): mixed |
|
36 | 36 | { |
37 | 37 | if ($value === null) { |
38 | 38 | return $value; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * Be warned, using the same groupSuffix with two different |
25 | 25 | * groups can cause collisions. |
26 | 26 | */ |
27 | - protected string|null $groupSuffix = null; |
|
27 | + protected string | null $groupSuffix = null; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @var bool When set to true hydrator results will be cached for the |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | * all hydrators will extract by reference. This overrides |
53 | 53 | * per-entity attribute configuration. |
54 | 54 | */ |
55 | - protected bool|null $globalByValue = null; |
|
55 | + protected bool | null $globalByValue = null; |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * @var string|null When set, the entityPrefix will be removed from each |
59 | 59 | * type name. This simplifies type names and makes reading |
60 | 60 | * the GraphQL documentation easier. |
61 | 61 | */ |
62 | - protected string|null $entityPrefix = null; |
|
62 | + protected string | null $entityPrefix = null; |
|
63 | 63 | |
64 | 64 | /** @param mixed[] $config */ |
65 | 65 | public function __construct(array $config = []) |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | return $this->group; |
87 | 87 | } |
88 | 88 | |
89 | - protected function setGroupSuffix(string|null $groupSuffix): self |
|
89 | + protected function setGroupSuffix(string | null $groupSuffix): self |
|
90 | 90 | { |
91 | 91 | $this->groupSuffix = $groupSuffix; |
92 | 92 | |
93 | 93 | return $this; |
94 | 94 | } |
95 | 95 | |
96 | - public function getGroupSuffix(): string|null |
|
96 | + public function getGroupSuffix(): string | null |
|
97 | 97 | { |
98 | 98 | return $this->groupSuffix; |
99 | 99 | } |
@@ -148,26 +148,26 @@ discard block |
||
148 | 148 | return $this->globalIgnore; |
149 | 149 | } |
150 | 150 | |
151 | - protected function setGlobalByValue(bool|null $globalByValue): self |
|
151 | + protected function setGlobalByValue(bool | null $globalByValue): self |
|
152 | 152 | { |
153 | 153 | $this->globalByValue = $globalByValue; |
154 | 154 | |
155 | 155 | return $this; |
156 | 156 | } |
157 | 157 | |
158 | - public function getGlobalByValue(): bool|null |
|
158 | + public function getGlobalByValue(): bool | null |
|
159 | 159 | { |
160 | 160 | return $this->globalByValue; |
161 | 161 | } |
162 | 162 | |
163 | - protected function setEntityPrefix(string|null $entityPrefix): self |
|
163 | + protected function setEntityPrefix(string | null $entityPrefix): self |
|
164 | 164 | { |
165 | 165 | $this->entityPrefix = $entityPrefix; |
166 | 166 | |
167 | 167 | return $this; |
168 | 168 | } |
169 | 169 | |
170 | - public function getEntityPrefix(): string|null |
|
170 | + public function getEntityPrefix(): string | null |
|
171 | 171 | { |
172 | 172 | return $this->entityPrefix; |
173 | 173 | } |
@@ -15,13 +15,13 @@ discard block |
||
15 | 15 | class Time extends ScalarType |
16 | 16 | { |
17 | 17 | // phpcs:disable SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingAnyTypeHint |
18 | - public string|null $description = 'The `Time` scalar type represents time data.' |
|
18 | + public string | null $description = 'The `Time` scalar type represents time data.' |
|
19 | 19 | . 'The format is e.g. 24 hour:minutes:seconds'; |
20 | 20 | |
21 | - public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string |
|
21 | + public function parseLiteral(ASTNode $valueNode, array | null $variables = null): string |
|
22 | 22 | { |
23 | 23 | // @codeCoverageIgnoreStart |
24 | - if (! $valueNode instanceof StringValueNode) { |
|
24 | + if (!$valueNode instanceof StringValueNode) { |
|
25 | 25 | throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode); |
26 | 26 | } |
27 | 27 | |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | |
33 | 33 | public function parseValue(mixed $value): PHPDateTime |
34 | 34 | { |
35 | - if (! is_string($value)) { |
|
35 | + if (!is_string($value)) { |
|
36 | 36 | throw new Error('Time is not a string: ' . $value); |
37 | 37 | } |
38 | 38 | |
39 | 39 | return PHPDateTime::createFromFormat('H:i:s.u', $value); |
40 | 40 | } |
41 | 41 | |
42 | - public function serialize(mixed $value): string|null |
|
42 | + public function serialize(mixed $value): string | null |
|
43 | 43 | { |
44 | 44 | if ($value instanceof PHPDateTime) { |
45 | 45 | $value = $value->format('H:i:s.u'); |
@@ -15,13 +15,13 @@ discard block |
||
15 | 15 | class DateImmutable extends ScalarType |
16 | 16 | { |
17 | 17 | // phpcs:disable SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingAnyTypeHint |
18 | - public string|null $description = 'The `date_immutable` scalar type represents datetime data.' |
|
18 | + public string | null $description = 'The `date_immutable` scalar type represents datetime data.' |
|
19 | 19 | . 'The format is e.g. 2004-02-12'; |
20 | 20 | |
21 | - public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string |
|
21 | + public function parseLiteral(ASTNode $valueNode, array | null $variables = null): string |
|
22 | 22 | { |
23 | 23 | // @codeCoverageIgnoreStart |
24 | - if (! $valueNode instanceof StringValueNode) { |
|
24 | + if (!$valueNode instanceof StringValueNode) { |
|
25 | 25 | throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode); |
26 | 26 | } |
27 | 27 | |
@@ -30,16 +30,16 @@ discard block |
||
30 | 30 | return $valueNode->value; |
31 | 31 | } |
32 | 32 | |
33 | - public function parseValue(mixed $value): PHPDateTime|false |
|
33 | + public function parseValue(mixed $value): PHPDateTime | false |
|
34 | 34 | { |
35 | - if (! is_string($value)) { |
|
35 | + if (!is_string($value)) { |
|
36 | 36 | throw new Error('Date is not a string: ' . $value); |
37 | 37 | } |
38 | 38 | |
39 | 39 | return PHPDateTime::createFromFormat('Y-m-d', $value); |
40 | 40 | } |
41 | 41 | |
42 | - public function serialize(mixed $value): string|null |
|
42 | + public function serialize(mixed $value): string | null |
|
43 | 43 | { |
44 | 44 | if ($value instanceof PHPDateTime) { |
45 | 45 | $value = $value->format('Y-m-d'); |
@@ -15,13 +15,13 @@ discard block |
||
15 | 15 | class DateTimeImmutable extends ScalarType |
16 | 16 | { |
17 | 17 | // phpcs:disable SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingAnyTypeHint |
18 | - public string|null $description = 'The `datetime_immutable` scalar type represents datetime data.' |
|
18 | + public string | null $description = 'The `datetime_immutable` scalar type represents datetime data.' |
|
19 | 19 | . 'The format is ISO-8601 e.g. 2004-02-12T15:19:21+00:00'; |
20 | 20 | |
21 | - public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string |
|
21 | + public function parseLiteral(ASTNode $valueNode, array | null $variables = null): string |
|
22 | 22 | { |
23 | 23 | // @codeCoverageIgnoreStart |
24 | - if (! $valueNode instanceof StringValueNode) { |
|
24 | + if (!$valueNode instanceof StringValueNode) { |
|
25 | 25 | throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode); |
26 | 26 | } |
27 | 27 | |
@@ -30,16 +30,16 @@ discard block |
||
30 | 30 | return $valueNode->value; |
31 | 31 | } |
32 | 32 | |
33 | - public function parseValue(mixed $value): PHPDateTime|false |
|
33 | + public function parseValue(mixed $value): PHPDateTime | false |
|
34 | 34 | { |
35 | - if (! is_string($value)) { |
|
35 | + if (!is_string($value)) { |
|
36 | 36 | throw new Error('Date is not a string: ' . $value); |
37 | 37 | } |
38 | 38 | |
39 | 39 | return PHPDateTime::createFromFormat('Y-m-d\TH:i:sP', $value); |
40 | 40 | } |
41 | 41 | |
42 | - public function serialize(mixed $value): string|null |
|
42 | + public function serialize(mixed $value): string | null |
|
43 | 43 | { |
44 | 44 | if ($value instanceof PHPDateTime) { |
45 | 45 | $value = $value->format('c'); |
@@ -15,13 +15,13 @@ discard block |
||
15 | 15 | class TimeImmutable extends ScalarType |
16 | 16 | { |
17 | 17 | // phpcs:disable SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingAnyTypeHint |
18 | - public string|null $description = 'The `Time` scalar type represents time data.' |
|
18 | + public string | null $description = 'The `Time` scalar type represents time data.' |
|
19 | 19 | . 'The format is e.g. 24 hour:minutes:seconds'; |
20 | 20 | |
21 | - public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string |
|
21 | + public function parseLiteral(ASTNode $valueNode, array | null $variables = null): string |
|
22 | 22 | { |
23 | 23 | // @codeCoverageIgnoreStart |
24 | - if (! $valueNode instanceof StringValueNode) { |
|
24 | + if (!$valueNode instanceof StringValueNode) { |
|
25 | 25 | throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode); |
26 | 26 | } |
27 | 27 | |
@@ -30,16 +30,16 @@ discard block |
||
30 | 30 | return $valueNode->value; |
31 | 31 | } |
32 | 32 | |
33 | - public function parseValue(mixed $value): PHPDateTime|false |
|
33 | + public function parseValue(mixed $value): PHPDateTime | false |
|
34 | 34 | { |
35 | - if (! is_string($value)) { |
|
35 | + if (!is_string($value)) { |
|
36 | 36 | throw new Error('Time is not a string: ' . $value); |
37 | 37 | } |
38 | 38 | |
39 | 39 | return PHPDateTime::createFromFormat('H:i:s.u', $value); |
40 | 40 | } |
41 | 41 | |
42 | - public function serialize(mixed $value): string|null |
|
42 | + public function serialize(mixed $value): string | null |
|
43 | 43 | { |
44 | 44 | if ($value instanceof PHPDateTime) { |
45 | 45 | $value = $value->format('H:i:s.u'); |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | class Json extends ScalarType |
16 | 16 | { |
17 | 17 | // phpcs:disable SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingAnyTypeHint |
18 | - public string|null $description = 'The `JSON` scalar type represents json data.'; |
|
18 | + public string | null $description = 'The `JSON` scalar type represents json data.'; |
|
19 | 19 | |
20 | - public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string |
|
20 | + public function parseLiteral(ASTNode $valueNode, array | null $variables = null): string |
|
21 | 21 | { |
22 | 22 | throw new Error('JSON fields are not searchable', $valueNode); |
23 | 23 | } |
@@ -27,16 +27,16 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @throws Error |
29 | 29 | */ |
30 | - public function parseValue(mixed $value): array|null |
|
30 | + public function parseValue(mixed $value): array | null |
|
31 | 31 | { |
32 | - if (! is_string($value)) { |
|
32 | + if (!is_string($value)) { |
|
33 | 33 | throw new Error('Json is not a string: ' . $value); |
34 | 34 | } |
35 | 35 | |
36 | 36 | return json_decode($value, true); |
37 | 37 | } |
38 | 38 | |
39 | - public function serialize(mixed $value): string|null |
|
39 | + public function serialize(mixed $value): string | null |
|
40 | 40 | { |
41 | 41 | return json_encode($value); |
42 | 42 | } |
@@ -15,13 +15,13 @@ discard block |
||
15 | 15 | class DateTime extends ScalarType |
16 | 16 | { |
17 | 17 | // phpcs:disable SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingAnyTypeHint |
18 | - public string|null $description = 'The `DateTime` scalar type represents datetime data.' |
|
18 | + public string | null $description = 'The `DateTime` scalar type represents datetime data.' |
|
19 | 19 | . 'The format is ISO-8601 e.g. 2004-02-12T15:19:21+00:00'; |
20 | 20 | |
21 | - public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string |
|
21 | + public function parseLiteral(ASTNode $valueNode, array | null $variables = null): string |
|
22 | 22 | { |
23 | 23 | // @codeCoverageIgnoreStart |
24 | - if (! $valueNode instanceof StringValueNode) { |
|
24 | + if (!$valueNode instanceof StringValueNode) { |
|
25 | 25 | throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode); |
26 | 26 | } |
27 | 27 | |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | |
33 | 33 | public function parseValue(mixed $value): PHPDateTime |
34 | 34 | { |
35 | - if (! is_string($value)) { |
|
35 | + if (!is_string($value)) { |
|
36 | 36 | throw new Error('Date is not a string: ' . $value); |
37 | 37 | } |
38 | 38 | |
39 | 39 | return PHPDateTime::createFromFormat('Y-m-d\TH:i:sP', $value); |
40 | 40 | } |
41 | 41 | |
42 | - public function serialize(mixed $value): string|null |
|
42 | + public function serialize(mixed $value): string | null |
|
43 | 43 | { |
44 | 44 | if ($value instanceof PHPDateTime) { |
45 | 45 | $value = $value->format('c'); |
@@ -15,13 +15,13 @@ discard block |
||
15 | 15 | class Date extends ScalarType |
16 | 16 | { |
17 | 17 | // phpcs:disable SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingAnyTypeHint |
18 | - public string|null $description = 'The `Date` scalar type represents datetime data.' |
|
18 | + public string | null $description = 'The `Date` scalar type represents datetime data.' |
|
19 | 19 | . 'The format is e.g. 2004-02-12'; |
20 | 20 | |
21 | - public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string |
|
21 | + public function parseLiteral(ASTNode $valueNode, array | null $variables = null): string |
|
22 | 22 | { |
23 | 23 | // @codeCoverageIgnoreStart |
24 | - if (! $valueNode instanceof StringValueNode) { |
|
24 | + if (!$valueNode instanceof StringValueNode) { |
|
25 | 25 | throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode); |
26 | 26 | } |
27 | 27 | |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | |
33 | 33 | public function parseValue(mixed $value): PHPDateTime |
34 | 34 | { |
35 | - if (! is_string($value)) { |
|
35 | + if (!is_string($value)) { |
|
36 | 36 | throw new Error('Date is not a string: ' . $value); |
37 | 37 | } |
38 | 38 | |
39 | 39 | return PHPDateTime::createFromFormat('Y-m-d', $value); |
40 | 40 | } |
41 | 41 | |
42 | - public function serialize(mixed $value): string|null |
|
42 | + public function serialize(mixed $value): string | null |
|
43 | 43 | { |
44 | 44 | if ($value instanceof PHPDateTime) { |
45 | 45 | $value = $value->format('Y-m-d'); |