@@ -208,7 +208,7 @@ |
||
| 208 | 208 | $this->target, |
| 209 | 209 | $relation |
| 210 | 210 | ); |
| 211 | - } catch (SchemaException | FactoryException $e) { |
|
| 211 | + } catch (SchemaException|FactoryException $e) { |
|
| 212 | 212 | throw new LoaderException( |
| 213 | 213 | sprintf('Unable to create loader: %s', $e->getMessage()), |
| 214 | 214 | $e->getCode(), |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | if ($args[0] instanceof Closure) { |
| 247 | - $args[0] = $args[0] = function ($q) use ($args): void { |
|
| 247 | + $args[0] = $args[0] = function($q) use ($args): void { |
|
| 248 | 248 | $args[0]($this->withQuery($q)); |
| 249 | 249 | }; |
| 250 | 250 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | if ($value instanceof Closure) { |
| 268 | - $value = function ($q) use ($value): void { |
|
| 268 | + $value = function($q) use ($value): void { |
|
| 269 | 269 | $value($this->withQuery($q)); |
| 270 | 270 | }; |
| 271 | 271 | } |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | */ |
| 117 | 117 | public function configureQuery(SelectQuery $query, array $outerKeys = []): SelectQuery |
| 118 | 118 | { |
| 119 | - if ($this->isLoaded() && $this->isJoined() && (int) $query->getLimit() !== 0) { |
|
| 119 | + if ($this->isLoaded() && $this->isJoined() && (int)$query->getLimit() !== 0) { |
|
| 120 | 120 | throw new LoaderException('Unable to load data using join with limit on parent query'); |
| 121 | 121 | } |
| 122 | 122 | |
@@ -47,13 +47,13 @@ |
||
| 47 | 47 | |
| 48 | 48 | switch ($rule) { |
| 49 | 49 | case 'int': |
| 50 | - $values[$key] = (int) $values[$key]; |
|
| 50 | + $values[$key] = (int)$values[$key]; |
|
| 51 | 51 | break; |
| 52 | 52 | case 'bool': |
| 53 | - $values[$key] = (bool) $values[$key]; |
|
| 53 | + $values[$key] = (bool)$values[$key]; |
|
| 54 | 54 | break; |
| 55 | 55 | case 'float': |
| 56 | - $values[$key] = (float) $values[$key]; |
|
| 56 | + $values[$key] = (float)$values[$key]; |
|
| 57 | 57 | break; |
| 58 | 58 | case 'datetime': |
| 59 | 59 | $values[$key] = new DateTimeImmutable( |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | return true; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - $criteria = (string) $data[$this->duplicateCriteria]; |
|
| 49 | + $criteria = (string)$data[$this->duplicateCriteria]; |
|
| 50 | 50 | |
| 51 | 51 | if (isset($this->duplicates[$criteria])) { |
| 52 | 52 | // duplicate is presented, let's reduplicate |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | */ |
| 117 | 117 | public function configureQuery(SelectQuery $query, array $outerKeys = []): SelectQuery |
| 118 | 118 | { |
| 119 | - if ($this->isLoaded() && $this->isJoined() && (int) $query->getLimit() !== 0) { |
|
| 119 | + if ($this->isLoaded() && $this->isJoined() && (int)$query->getLimit() !== 0) { |
|
| 120 | 120 | throw new LoaderException('Unable to load data using join with limit on parent query'); |
| 121 | 121 | } |
| 122 | 122 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | protected function calcDeleted(array $related, array $original) |
| 124 | 124 | { |
| 125 | - return array_udiff($original ?? [], $related, function ($a, $b) { |
|
| 125 | + return array_udiff($original ?? [], $related, function($a, $b) { |
|
| 126 | 126 | return strcmp(spl_object_hash($a), spl_object_hash($b)); |
| 127 | 127 | }); |
| 128 | 128 | } |
@@ -166,12 +166,12 @@ discard block |
||
| 166 | 166 | $store->register($this->columnName($rNode, $this->outerKey), null, true); |
| 167 | 167 | $rNode->getState()->decClaim(); |
| 168 | 168 | |
| 169 | - return new Condition($store, function () use ($rNode) { |
|
| 169 | + return new Condition($store, function() use ($rNode) { |
|
| 170 | 170 | return !$rNode->getState()->hasClaims(); |
| 171 | 171 | }); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - return new Condition($this->orm->queueDelete($related), function () use ($rNode) { |
|
| 174 | + return new Condition($this->orm->queueDelete($related), function() use ($rNode) { |
|
| 175 | 175 | return !$rNode->getState()->hasClaims(); |
| 176 | 176 | }); |
| 177 | 177 | } |
@@ -90,13 +90,13 @@ |
||
| 90 | 90 | $store->register($this->columnName($rNode, $this->outerKey), null, true); |
| 91 | 91 | $rNode->getState()->decClaim(); |
| 92 | 92 | |
| 93 | - return new Condition($store, function () use ($rNode) { |
|
| 93 | + return new Condition($store, function() use ($rNode) { |
|
| 94 | 94 | return !$rNode->getState()->hasClaims(); |
| 95 | 95 | }); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // only delete original child when no other objects claim it |
| 99 | - return new Condition($this->orm->queueDelete($original), function () use ($rNode) { |
|
| 99 | + return new Condition($this->orm->queueDelete($original), function() use ($rNode) { |
|
| 100 | 100 | return !$rNode->getState()->hasClaims(); |
| 101 | 101 | }); |
| 102 | 102 | } |
@@ -338,7 +338,7 @@ |
||
| 338 | 338 | */ |
| 339 | 339 | protected function mountArray(string $container, string $key, $criteria, array &$data): void |
| 340 | 340 | { |
| 341 | - $criteria = (string) $criteria; |
|
| 341 | + $criteria = (string)$criteria; |
|
| 342 | 342 | |
| 343 | 343 | if (!array_key_exists($criteria, $this->references[$key])) { |
| 344 | 344 | throw new ParserException("Undefined reference `{$key}`.`{$criteria}`"); |