@@ -13,27 +13,27 @@ |
||
13 | 13 | { |
14 | 14 | public function __construct( |
15 | 15 | protected ContainerInterface $container, |
16 | - protected array|null $metadataConfig, |
|
16 | + protected array | null $metadataConfig, |
|
17 | 17 | ) { |
18 | 18 | } |
19 | 19 | |
20 | 20 | /** @throws Error */ |
21 | 21 | public function get(string $id): Entity |
22 | 22 | { |
23 | - if (! isset($this->metadataConfig[$id])) { |
|
23 | + if (!isset($this->metadataConfig[$id])) { |
|
24 | 24 | throw new Error( |
25 | 25 | 'Entity ' . $id . ' is not mapped in the metadata', |
26 | 26 | ); |
27 | 27 | } |
28 | 28 | |
29 | - if (! $this->has($id)) { |
|
29 | + if (!$this->has($id)) { |
|
30 | 30 | $this->set($id, new Entity($this->container, $this->metadataConfig[$id])); |
31 | 31 | } |
32 | 32 | |
33 | 33 | return parent::get($id); |
34 | 34 | } |
35 | 35 | |
36 | - public function getMetadataConfig(): array|null |
|
36 | + public function getMetadataConfig(): array | null |
|
37 | 37 | { |
38 | 38 | return $this->metadataConfig; |
39 | 39 | } |
@@ -12,9 +12,9 @@ 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, |
|
17 | - protected string|null $type = null, |
|
15 | + protected string | null $strategy = null, |
|
16 | + protected string | null $description = null, |
|
17 | + protected string | null $type = null, |
|
18 | 18 | private array $excludeCriteria = [], |
19 | 19 | ) { |
20 | 20 | } |
@@ -24,17 +24,17 @@ discard block |
||
24 | 24 | return $this->group; |
25 | 25 | } |
26 | 26 | |
27 | - public function getStrategy(): string|null |
|
27 | + public function getStrategy(): string | null |
|
28 | 28 | { |
29 | 29 | return $this->strategy; |
30 | 30 | } |
31 | 31 | |
32 | - public function getDescription(): string|null |
|
32 | + public function getDescription(): string | null |
|
33 | 33 | { |
34 | 34 | return $this->description; |
35 | 35 | } |
36 | 36 | |
37 | - public function getType(): string|null |
|
37 | + public function getType(): string | null |
|
38 | 38 | { |
39 | 39 | return $this->type; |
40 | 40 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public function get(Entity $entity, string $eventName): Closure |
33 | 33 | { |
34 | - return function ($objectValue, array $args, $context, ResolveInfo $info) use ($entity, $eventName) { |
|
34 | + return function($objectValue, array $args, $context, ResolveInfo $info) use ($entity, $eventName) { |
|
35 | 35 | $entityClass = $entity->getEntityClass(); |
36 | 36 | |
37 | 37 | $queryBuilderFilter = (new Applicator($this->entityManager, $entityClass)) |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $itemCount = $paginator->count(); |
177 | 177 | |
178 | 178 | // Rebuild paginator if needed |
179 | - if ($last && ! $before) { |
|
179 | + if ($last && !$before) { |
|
180 | 180 | $offset = $itemCount - $last; |
181 | 181 | $queryBuilder->setFirstResult($offset); |
182 | 182 | $paginator = new Paginator($queryBuilder->getQuery()); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | ]; |
194 | 194 | |
195 | 195 | $lastCursor = $cursor; |
196 | - if (! $firstCursor) { |
|
196 | + if (!$firstCursor) { |
|
197 | 197 | $firstCursor = $cursor; |
198 | 198 | } |
199 | 199 |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | /** @param mixed[]|null $associationMetadata */ |
34 | 34 | public function get( |
35 | 35 | Entity $targetEntity, |
36 | - Entity|null $owningEntity = null, |
|
37 | - string|null $associationName = null, |
|
38 | - array|null $associationMetadata = null, |
|
36 | + Entity | null $owningEntity = null, |
|
37 | + string | null $associationName = null, |
|
38 | + array | null $associationMetadata = null, |
|
39 | 39 | ): InputObjectType { |
40 | 40 | $typeName = $owningEntity ? |
41 | 41 | $owningEntity->getTypeName() . '_' . $associationName . '_filter' |
@@ -53,22 +53,22 @@ discard block |
||
53 | 53 | // Limit entity filters |
54 | 54 | if ($entityMetadata['excludeCriteria']) { |
55 | 55 | $excludeCriteria = $entityMetadata['excludeCriteria']; |
56 | - $allowedFilters = array_filter($allowedFilters, static function ($value) use ($excludeCriteria) { |
|
57 | - return ! in_array($value, $excludeCriteria); |
|
56 | + $allowedFilters = array_filter($allowedFilters, static function($value) use ($excludeCriteria) { |
|
57 | + return !in_array($value, $excludeCriteria); |
|
58 | 58 | }); |
59 | 59 | } |
60 | 60 | |
61 | 61 | // Limit association filters |
62 | 62 | if ($associationName) { |
63 | 63 | $excludeCriteria = $associationMetadata['excludeCriteria']; |
64 | - $allowedFilters = array_filter($allowedFilters, static function ($value) use ($excludeCriteria) { |
|
65 | - return ! in_array($value, $excludeCriteria); |
|
64 | + $allowedFilters = array_filter($allowedFilters, static function($value) use ($excludeCriteria) { |
|
65 | + return !in_array($value, $excludeCriteria); |
|
66 | 66 | }); |
67 | 67 | } |
68 | 68 | |
69 | 69 | foreach ($classMetadata->getFieldNames() as $fieldName) { |
70 | 70 | // Only process fields that are in the graphql metadata |
71 | - if (! in_array($fieldName, array_keys($entityMetadata['fields']))) { |
|
71 | + if (!in_array($fieldName, array_keys($entityMetadata['fields']))) { |
|
72 | 72 | continue; |
73 | 73 | } |
74 | 74 | |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | $fieldExcludeCriteria = $entityMetadata['fields'][$fieldName]['excludeCriteria']; |
93 | 93 | $allowedFilters = array_filter( |
94 | 94 | $allowedFilters, |
95 | - static function ($value) use ($fieldExcludeCriteria) { |
|
96 | - return ! in_array($value, $fieldExcludeCriteria); |
|
95 | + static function($value) use ($fieldExcludeCriteria) { |
|
96 | + return !in_array($value, $fieldExcludeCriteria); |
|
97 | 97 | }, |
98 | 98 | ); |
99 | 99 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | // Add eq filter for to-one associations |
109 | 109 | foreach ($classMetadata->getAssociationNames() as $associationName) { |
110 | 110 | // Only process fields which are in the graphql metadata |
111 | - if (! in_array($associationName, array_keys($entityMetadata['fields']))) { |
|
111 | + if (!in_array($associationName, array_keys($entityMetadata['fields']))) { |
|
112 | 112 | continue; |
113 | 113 | } |
114 | 114 |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | class BetweenInputObjectType extends InputObjectType |
14 | 14 | { |
15 | - public function __construct(string $typeName, string $fieldName, ScalarType|ListOfType $type) |
|
15 | + public function __construct(string $typeName, string $fieldName, ScalarType | ListOfType $type) |
|
16 | 16 | { |
17 | 17 | $fields = [ |
18 | 18 | 'from' => new InputObjectField([ |
@@ -13,7 +13,7 @@ |
||
13 | 13 | class FiltersInputObjectType extends InputObjectType |
14 | 14 | { |
15 | 15 | /** @param string[] $allowedFilters */ |
16 | - public function __construct(string $typeName, string $fieldName, ScalarType|ListOfType $type, array $allowedFilters) |
|
16 | + public function __construct(string $typeName, string $fieldName, ScalarType | ListOfType $type, array $allowedFilters) |
|
17 | 17 | { |
18 | 18 | $fields = []; |
19 | 19 | $descriptions = FiltersDef::getDescriptions(); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | * no reason to set or update an identifier. For the case where an identifier |
47 | 47 | * should be set or updated, this facotry is not the correct solution. |
48 | 48 | */ |
49 | - if (! empty($optionalFields) || ! empty($requiredFields)) { |
|
49 | + if (!empty($optionalFields) || !empty($requiredFields)) { |
|
50 | 50 | // Include field as optional |
51 | 51 | if (in_array($fieldName, $optionalFields) || $optionalFields === ['*']) { |
52 | 52 | if ($optionalFields === ['*'] && $this->entityManager->getClassMetadata($id)->isIdentifier($fieldName)) { |
@@ -12,10 +12,10 @@ 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 | - protected string|null $filterCriteriaEventName = null, |
|
18 | + protected string | null $filterCriteriaEventName = null, |
|
19 | 19 | ) { |
20 | 20 | } |
21 | 21 | |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | return $this->group; |
25 | 25 | } |
26 | 26 | |
27 | - public function getStrategy(): string|null |
|
27 | + public function getStrategy(): string | null |
|
28 | 28 | { |
29 | 29 | return $this->strategy; |
30 | 30 | } |
31 | 31 | |
32 | - public function getDescription(): string|null |
|
32 | + public function getDescription(): string | null |
|
33 | 33 | { |
34 | 34 | return $this->description; |
35 | 35 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | return $this->excludeCriteria; |
41 | 41 | } |
42 | 42 | |
43 | - public function getFilterCriteriaEventName(): string|null |
|
43 | + public function getFilterCriteriaEventName(): string | null |
|
44 | 44 | { |
45 | 45 | return $this->filterCriteriaEventName; |
46 | 46 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | public function get(Entity $entity): Closure |
58 | 58 | { |
59 | - return function ($source, array $args, $context, ResolveInfo $info) { |
|
59 | + return function($source, array $args, $context, ResolveInfo $info) { |
|
60 | 60 | $fieldResolver = $this->fieldResolver; |
61 | 61 | $collection = $fieldResolver($source, $args, $context, $info); |
62 | 62 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
120 | - if (! empty($orderBy)) { |
|
120 | + if (!empty($orderBy)) { |
|
121 | 121 | $criteria->orderBy($orderBy); |
122 | 122 | } |
123 | 123 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | array $pagination, |
134 | 134 | PersistentCollection $collection, |
135 | 135 | Criteria $criteria, |
136 | - string|null $filterCriteriaEventName, |
|
136 | + string | null $filterCriteriaEventName, |
|
137 | 137 | mixed ...$resolve, |
138 | 138 | ): array { |
139 | 139 | $first = 0; |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | // Get total count from collection then match |
181 | 181 | $itemCount = count($collection->matching($criteria)); |
182 | 182 | |
183 | - if ($last && ! $before) { |
|
183 | + if ($last && !$before) { |
|
184 | 184 | $offset = $itemCount - $last; |
185 | 185 | } |
186 | 186 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | ]; |
222 | 222 | |
223 | 223 | $lastCursor = $cursor; |
224 | - if (! $firstCursor) { |
|
224 | + if (!$firstCursor) { |
|
225 | 225 | $firstCursor = $cursor; |
226 | 226 | } |
227 | 227 |