@@ -49,7 +49,7 @@ |
||
49 | 49 | |
50 | 50 | public function collect(iterable $data): array |
51 | 51 | { |
52 | - return match (true) { |
|
52 | + return match(true) { |
|
53 | 53 | \is_array($data) => $data, |
54 | 54 | $data instanceof \Traversable => \iterator_to_array($data), |
55 | 55 | default => throw new CollectionFactoryException('Unsupported iterable type.'), |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | $status = $tuple->task === Tuple::TASK_STORE && $tuple->node->getStatus() === Node::NEW |
22 | 22 | ? 'Create new' |
23 | - : match ($tuple->task) { |
|
23 | + : match($tuple->task) { |
|
24 | 24 | Tuple::TASK_STORE => 'Update', |
25 | 25 | default => 'Delete', |
26 | 26 | }; |
@@ -114,7 +114,7 @@ |
||
114 | 114 | ])] |
115 | 115 | string $class |
116 | 116 | ): object { |
117 | - return match ($class) { |
|
117 | + return match($class) { |
|
118 | 118 | EntityFactoryInterface::class => $this->entityFactory, |
119 | 119 | EntityProviderInterface::class => $this->entityProvider, |
120 | 120 | SourceProviderInterface::class => $this->sourceProvider, |
@@ -111,7 +111,7 @@ |
||
111 | 111 | */ |
112 | 112 | public function getStatus(): int |
113 | 113 | { |
114 | - return $this->state?->getStatus() ?? $this->status; |
|
114 | + return $this->state ? ->getStatus() ?? $this->status; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | if (!$isComposite) { |
72 | - $value = (string) current($scope); |
|
72 | + $value = (string)current($scope); |
|
73 | 73 | return $this->paths[$role][$indexName][$value] ?? null; |
74 | 74 | } |
75 | 75 | $result = null; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | } |
95 | 95 | $indexKeys ??= explode(self::INDEX_KEY_SEPARATOR, $indexName); |
96 | 96 | foreach ($indexKeys as $key) { |
97 | - $value = (string) $scope[$key]; |
|
97 | + $value = (string)$scope[$key]; |
|
98 | 98 | if (!isset($result[$value])) { |
99 | 99 | return null; |
100 | 100 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | : \sprintf('DISTINCT(%s)', $pk); |
180 | 180 | } |
181 | 181 | |
182 | - return (int) $this->__call('count', [$column]); |
|
182 | + return (int)$this->__call('count', [$column]); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | } |
478 | 478 | } |
479 | 479 | |
480 | - $this->__call('where', [static function (Select\QueryBuilder $q) use ($prepared) { |
|
480 | + $this->__call('where', [static function(Select\QueryBuilder $q) use ($prepared) { |
|
481 | 481 | foreach ($prepared as $set) { |
482 | 482 | $q->orWhere($set); |
483 | 483 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | ): ?string { |
319 | 319 | $nullable = $relation[Relation::SCHEMA][Relation::NULLABLE] ?? null; |
320 | 320 | /** @var callable $compareCallback */ |
321 | - $compareCallback = match ($relation[Relation::TYPE]) { |
|
321 | + $compareCallback = match($relation[Relation::TYPE]) { |
|
322 | 322 | Relation::MANY_TO_MANY => [$this, 'compareManyToMany'], |
323 | 323 | Relation::BELONGS_TO => [$this, 'checkBelongsToInversion'], |
324 | 324 | // Relation::HAS_ONE, Relation::HAS_MANY => $nullable === true ? Relation::REFERS_TO : Relation::BELONGS_TO, |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | return false; |
365 | 365 | } |
366 | 366 | // Optional fields |
367 | - return ! (($schema[Relation::WHERE] ?? []) !== ($targetSchema[Relation::WHERE] ?? []) |
|
367 | + return !(($schema[Relation::WHERE] ?? []) !== ($targetSchema[Relation::WHERE] ?? []) |
|
368 | 368 | || ($schema[Relation::THROUGH_WHERE] ?? []) !== ($targetSchema[Relation::THROUGH_WHERE] ?? [])); |
369 | 369 | } |
370 | 370 |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | public function configureQuery(SelectQuery $query, array $outerKeys = []): SelectQuery |
111 | 111 | { |
112 | - if ($this->isLoaded() && $this->isJoined() && (int) $query->getLimit() !== 0) { |
|
112 | + if ($this->isLoaded() && $this->isJoined() && (int)$query->getLimit() !== 0) { |
|
113 | 113 | throw new LoaderException('Unable to load data using join with limit on parent query'); |
114 | 114 | } |
115 | 115 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $query->andWhere($fields[0], 'IN', new Parameter(array_column($outerKeys, key($outerKeys[0])))); |
175 | 175 | } else { |
176 | 176 | $query->andWhere( |
177 | - static function (SelectQuery $select) use ($outerKeys, $fields) { |
|
177 | + static function(SelectQuery $select) use ($outerKeys, $fields) { |
|
178 | 178 | foreach ($outerKeys as $set) { |
179 | 179 | $select->orWhere(array_combine($fields, array_values($set))); |
180 | 180 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | public function configureQuery(SelectQuery $query, array $outerKeys = []): SelectQuery |
57 | 57 | { |
58 | - if ($this->isLoaded() && $this->isJoined() && (int) $query->getLimit() !== 0) { |
|
58 | + if ($this->isLoaded() && $this->isJoined() && (int)$query->getLimit() !== 0) { |
|
59 | 59 | throw new LoaderException('Unable to load data using join with limit on parent query'); |
60 | 60 | } |
61 | 61 |