@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * Be warned, using the same groupSuffix with two different |
21 | 21 | * groups can cause collisions. |
22 | 22 | */ |
23 | - protected string|null $groupSuffix = null; |
|
23 | + protected string | null $groupSuffix = null; |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * @var bool When set to true hydrator results will be cached for the |
@@ -48,14 +48,14 @@ discard block |
||
48 | 48 | * all hydrators will extract by reference. This overrides |
49 | 49 | * per-entity attribute configuration. |
50 | 50 | */ |
51 | - protected bool|null $globalByValue = null; |
|
51 | + protected bool | null $globalByValue = null; |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * @var string|null When set, the entityPrefix will be removed from each |
55 | 55 | * type name. This simplifies type names and makes reading |
56 | 56 | * the GraphQL documentation easier. |
57 | 57 | */ |
58 | - protected string|null $entityPrefix = null; |
|
58 | + protected string | null $entityPrefix = null; |
|
59 | 59 | |
60 | 60 | /** @param mixed[] $config */ |
61 | 61 | public function __construct(array $config = []) |
@@ -82,14 +82,14 @@ discard block |
||
82 | 82 | return $this->group; |
83 | 83 | } |
84 | 84 | |
85 | - protected function setGroupSuffix(string|null $groupSuffix): self |
|
85 | + protected function setGroupSuffix(string | null $groupSuffix): self |
|
86 | 86 | { |
87 | 87 | $this->groupSuffix = $groupSuffix; |
88 | 88 | |
89 | 89 | return $this; |
90 | 90 | } |
91 | 91 | |
92 | - public function getGroupSuffix(): string|null |
|
92 | + public function getGroupSuffix(): string | null |
|
93 | 93 | { |
94 | 94 | return $this->groupSuffix; |
95 | 95 | } |
@@ -144,26 +144,26 @@ discard block |
||
144 | 144 | return $this->globalIgnore; |
145 | 145 | } |
146 | 146 | |
147 | - protected function setGlobalByValue(bool|null $globalByValue): self |
|
147 | + protected function setGlobalByValue(bool | null $globalByValue): self |
|
148 | 148 | { |
149 | 149 | $this->globalByValue = $globalByValue; |
150 | 150 | |
151 | 151 | return $this; |
152 | 152 | } |
153 | 153 | |
154 | - public function getGlobalByValue(): bool|null |
|
154 | + public function getGlobalByValue(): bool | null |
|
155 | 155 | { |
156 | 156 | return $this->globalByValue; |
157 | 157 | } |
158 | 158 | |
159 | - protected function setEntityPrefix(string|null $entityPrefix): self |
|
159 | + protected function setEntityPrefix(string | null $entityPrefix): self |
|
160 | 160 | { |
161 | 161 | $this->entityPrefix = $entityPrefix; |
162 | 162 | |
163 | 163 | return $this; |
164 | 164 | } |
165 | 165 | |
166 | - public function getEntityPrefix(): string|null |
|
166 | + public function getEntityPrefix(): string | null |
|
167 | 167 | { |
168 | 168 | return $this->entityPrefix; |
169 | 169 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $fields = []; |
42 | 42 | $targetEntity = $this->typeManager->build(Entity::class, $id); |
43 | 43 | |
44 | - if (! count($requiredFields) && ! count($optionalFields)) { |
|
44 | + if (!count($requiredFields) && !count($optionalFields)) { |
|
45 | 45 | $this->addAllFieldsAsRequired($targetEntity, $fields); |
46 | 46 | } else { |
47 | 47 | $this->addRequiredFields($targetEntity, $requiredFields, $fields); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | array &$fields, |
66 | 66 | ): void { |
67 | 67 | foreach ($this->entityManager->getClassMetadata($targetEntity->getEntityClass())->getFieldNames() as $fieldName) { |
68 | - if (! in_array($fieldName, $optionalFields) && $optionalFields !== ['*']) { |
|
68 | + if (!in_array($fieldName, $optionalFields) && $optionalFields !== ['*']) { |
|
69 | 69 | continue; |
70 | 70 | } |
71 | 71 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | array &$fields, |
97 | 97 | ): void { |
98 | 98 | foreach ($this->entityManager->getClassMetadata($targetEntity->getEntityClass())->getFieldNames() as $fieldName) { |
99 | - if (! in_array($fieldName, $requiredFields) && $requiredFields !== ['*']) { |
|
99 | + if (!in_array($fieldName, $requiredFields) && $requiredFields !== ['*']) { |
|
100 | 100 | continue; |
101 | 101 | } |
102 | 102 |
@@ -7,11 +7,11 @@ |
||
7 | 7 | class Metadata |
8 | 8 | { |
9 | 9 | public function __construct( |
10 | - protected array|null $metadataConfig, |
|
10 | + protected array | null $metadataConfig, |
|
11 | 11 | ) { |
12 | 12 | } |
13 | 13 | |
14 | - public function __invoke(): array|null |
|
14 | + public function __invoke(): array | null |
|
15 | 15 | { |
16 | 16 | return $this->metadataConfig; |
17 | 17 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $this->metadata = $container->get(Metadata::class); |
62 | 62 | $this->typeManager = $container->get(TypeManager::class); |
63 | 63 | |
64 | - if (! isset(($this->metadata)()[$typeName])) { |
|
64 | + if (!isset(($this->metadata)()[$typeName])) { |
|
65 | 65 | throw new Error( |
66 | 66 | 'Entity ' . $typeName . ' is not mapped in the metadata', |
67 | 67 | ); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | return $this->metadataConfig['typeName']; |
86 | 86 | } |
87 | 87 | |
88 | - public function getDescription(): string|null |
|
88 | + public function getDescription(): string | null |
|
89 | 89 | { |
90 | 90 | return $this->metadataConfig['description']; |
91 | 91 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $classMetadata = $this->entityManager->getClassMetadata($this->getEntityClass()); |
145 | 145 | |
146 | 146 | foreach ($classMetadata->getFieldNames() as $fieldName) { |
147 | - if (! in_array($fieldName, array_keys($this->metadataConfig['fields']))) { |
|
147 | + if (!in_array($fieldName, array_keys($this->metadataConfig['fields']))) { |
|
148 | 148 | continue; |
149 | 149 | } |
150 | 150 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $classMetadata = $this->entityManager->getClassMetadata($this->getEntityClass()); |
163 | 163 | |
164 | 164 | foreach ($classMetadata->getAssociationNames() as $associationName) { |
165 | - if (! in_array($associationName, array_keys($this->metadataConfig['fields']))) { |
|
165 | + if (!in_array($associationName, array_keys($this->metadataConfig['fields']))) { |
|
166 | 166 | continue; |
167 | 167 | } |
168 | 168 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | case ClassMetadataInfo::MANY_TO_ONE: |
174 | 174 | case ClassMetadataInfo::TO_ONE: |
175 | 175 | $targetEntity = $associationMetadata['targetEntity']; |
176 | - $fields[$associationName] = function () use ($targetEntity) { |
|
176 | + $fields[$associationName] = function() use ($targetEntity) { |
|
177 | 177 | $entity = $this->typeManager->build(self::class, $targetEntity); |
178 | 178 | |
179 | 179 | return [ |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | case ClassMetadataInfo::MANY_TO_MANY: |
187 | 187 | case ClassMetadataInfo::TO_MANY: |
188 | 188 | $targetEntity = $associationMetadata['targetEntity']; |
189 | - $fields[$associationName] = function () use ($targetEntity, $associationName) { |
|
189 | + $fields[$associationName] = function() use ($targetEntity, $associationName) { |
|
190 | 190 | $entity = $this->typeManager->build(self::class, $targetEntity); |
191 | 191 | $shortName = $this->getTypeName() . '_' . $associationName; |
192 | 192 |