@@ -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'); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | * @param Config $config required |
18 | 18 | * @param Metadata\Metadata|null $metadata optional so cached metadata can be loaded |
19 | 19 | */ |
20 | - public function __construct(EntityManager $entityManager, Config|null $config = null, array|null $metadataConfig = null) |
|
20 | + public function __construct(EntityManager $entityManager, Config | null $config = null, array | null $metadataConfig = null) |
|
21 | 21 | { |
22 | 22 | // Services for this container are initialized in the Services class |
23 | 23 | new Services($this, $entityManager, $config, $metadataConfig); |
@@ -12,8 +12,8 @@ discard block |
||
12 | 12 | /** @param string[] $excludeCriteria */ |
13 | 13 | public function __construct( |
14 | 14 | protected string $group = 'default', |
15 | - protected string|null $strategy = null, |
|
16 | - protected string|null $description = null, |
|
15 | + protected string | null $strategy = null, |
|
16 | + protected string | null $description = null, |
|
17 | 17 | protected array $excludeCriteria = [], |
18 | 18 | ) { |
19 | 19 | } |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | return $this->group; |
24 | 24 | } |
25 | 25 | |
26 | - public function getStrategy(): string|null |
|
26 | + public function getStrategy(): string | null |
|
27 | 27 | { |
28 | 28 | return $this->strategy; |
29 | 29 | } |
30 | 30 | |
31 | - public function getDescription(): string|null |
|
31 | + public function getDescription(): string | null |
|
32 | 32 | { |
33 | 33 | return $this->description; |
34 | 34 | } |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | { |
12 | 12 | public function __construct( |
13 | 13 | protected string $group = 'default', |
14 | - protected string|null $strategy = null, |
|
15 | - protected string|null $description = null, |
|
16 | - protected string|null $type = null, |
|
14 | + protected string | null $strategy = null, |
|
15 | + protected string | null $description = null, |
|
16 | + protected string | null $type = null, |
|
17 | 17 | ) { |
18 | 18 | } |
19 | 19 | |
@@ -22,17 +22,17 @@ discard block |
||
22 | 22 | return $this->group; |
23 | 23 | } |
24 | 24 | |
25 | - public function getStrategy(): string|null |
|
25 | + public function getStrategy(): string | null |
|
26 | 26 | { |
27 | 27 | return $this->strategy; |
28 | 28 | } |
29 | 29 | |
30 | - public function getDescription(): string|null |
|
30 | + public function getDescription(): string | null |
|
31 | 31 | { |
32 | 32 | return $this->description; |
33 | 33 | } |
34 | 34 | |
35 | - public function getType(): string|null |
|
35 | + public function getType(): string | null |
|
36 | 36 | { |
37 | 37 | return $this->type; |
38 | 38 | } |
@@ -24,16 +24,16 @@ discard block |
||
24 | 24 | public function __construct( |
25 | 25 | Driver $driver, |
26 | 26 | EntityManager $entityManager, |
27 | - Config|null $config = null, |
|
28 | - array|null $metadataConfig = null, |
|
27 | + Config | null $config = null, |
|
28 | + array | null $metadataConfig = null, |
|
29 | 29 | ) { |
30 | 30 | $driver |
31 | 31 | // Plain classes |
32 | 32 | ->set(EntityManager::class, $entityManager) |
33 | 33 | ->set( |
34 | 34 | Config::class, |
35 | - static function () use ($config) { |
|
36 | - if (! $config) { |
|
35 | + static function() use ($config) { |
|
36 | + if (!$config) { |
|
37 | 37 | $config = new Config(); |
38 | 38 | } |
39 | 39 | |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | ) |
51 | 51 | ->set( |
52 | 52 | Metadata\Metadata::class, |
53 | - static function (ContainerInterface $container) use ($metadataConfig) { |
|
53 | + static function(ContainerInterface $container) use ($metadataConfig) { |
|
54 | 54 | return (new Metadata\MetadataFactory($container, $metadataConfig))->getMetadata(); |
55 | 55 | }, |
56 | 56 | ) |
57 | 57 | ->set( |
58 | 58 | Resolve\FieldResolver::class, |
59 | - static function (ContainerInterface $container) { |
|
59 | + static function(ContainerInterface $container) { |
|
60 | 60 | return new Resolve\FieldResolver( |
61 | 61 | $container->get(Config::class), |
62 | 62 | $container->get(Metadata\Metadata::class), |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | ) |
66 | 66 | ->set( |
67 | 67 | Resolve\ResolveCollectionFactory::class, |
68 | - static function (ContainerInterface $container) { |
|
68 | + static function(ContainerInterface $container) { |
|
69 | 69 | return new Resolve\ResolveCollectionFactory( |
70 | 70 | $container->get(EntityManager::class), |
71 | 71 | $container->get(Config::class), |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | ) |
77 | 77 | ->set( |
78 | 78 | Resolve\ResolveEntityFactory::class, |
79 | - static function (ContainerInterface $container) { |
|
79 | + static function(ContainerInterface $container) { |
|
80 | 80 | return new Resolve\ResolveEntityFactory( |
81 | 81 | $container->get(Config::class), |
82 | 82 | $container->get(EntityManager::class), |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | ) |
87 | 87 | ->set( |
88 | 88 | Criteria\CriteriaFactory::class, |
89 | - static function (ContainerInterface $container) { |
|
89 | + static function(ContainerInterface $container) { |
|
90 | 90 | return new Criteria\CriteriaFactory( |
91 | 91 | $container->get(Config::class), |
92 | 92 | $container->get(EntityManager::class), |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | ) |
98 | 98 | ->set( |
99 | 99 | Hydrator\HydratorFactory::class, |
100 | - static function (ContainerInterface $container) { |
|
100 | + static function(ContainerInterface $container) { |
|
101 | 101 | return new Hydrator\HydratorFactory( |
102 | 102 | $container->get(EntityManager::class), |
103 | 103 | $container->get(Metadata\Metadata::class), |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | ) |
107 | 107 | ->set( |
108 | 108 | Input\InputFactory::class, |
109 | - static function (ContainerInterface $container) { |
|
109 | + static function(ContainerInterface $container) { |
|
110 | 110 | return new Input\InputFactory( |
111 | 111 | $container->get(Config::class), |
112 | 112 | $container->get(EntityManager::class), |