@@ -78,7 +78,7 @@ |
||
| 78 | 78 | private function createHydrator(string $className): Closure |
| 79 | 79 | { |
| 80 | 80 | /** @var Closure(array<string, mixed>, T):void */ |
| 81 | - return Closure::bind(static function (array $row, object $entity) { |
|
| 81 | + return Closure::bind(static function(array $row, object $entity) { |
|
| 82 | 82 | foreach ($row as $property => $value) { |
| 83 | 83 | $entity->$property = $value; |
| 84 | 84 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | return $this->asClass($options); |
| 61 | 61 | |
| 62 | 62 | default: |
| 63 | - throw new DBALException('Unsupported fetch mode ' . $mode); |
|
| 63 | + throw new DBALException('Unsupported fetch mode '.$mode); |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | return new UpdateResultSet((int) $this->executeStatement($statement, $query->getBindings())); |
| 296 | 296 | } catch (DriverException $e) { |
| 297 | 297 | throw new QueryExecutionException( |
| 298 | - 'Error on execute : ' . $e->getMessage(), |
|
| 298 | + 'Error on execute : '.$e->getMessage(), |
|
| 299 | 299 | $e->getCode(), |
| 300 | 300 | $e, |
| 301 | 301 | $e->getQuery() ? $e->getQuery()->getSQL() : null, |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | } |
| 449 | 449 | } catch (DriverException $e) { |
| 450 | 450 | throw new QueryExecutionException( |
| 451 | - 'Error on execute : ' . $e->getMessage(), |
|
| 451 | + 'Error on execute : '.$e->getMessage(), |
|
| 452 | 452 | $e->getCode(), |
| 453 | 453 | $e, |
| 454 | 454 | $e->getQuery() ? $e->getQuery()->getSQL() : null, |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $values = []; |
| 47 | 47 | $attributes = array_flip($attributes); |
| 48 | 48 | |
| 49 | - $privatePrefix = "\0" . get_class($object) . "\0"; |
|
| 49 | + $privatePrefix = "\0".get_class($object)."\0"; |
|
| 50 | 50 | $privatePrefixLen = strlen($privatePrefix); |
| 51 | 51 | |
| 52 | 52 | foreach ((array) $object as $name => $property) { |
@@ -83,13 +83,13 @@ discard block |
||
| 83 | 83 | return $this->hydratorsCache[$entityClass]; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - $hydrator = static function ($object, array $data): void { |
|
| 86 | + $hydrator = static function($object, array $data): void { |
|
| 87 | 87 | foreach ($data as $property => $value) { |
| 88 | 88 | try { |
| 89 | 89 | if (isset($object->$property) && $object->$property instanceof ImportableInterface && is_array($value)) { |
| 90 | 90 | $object->$property->import($value); |
| 91 | - } elseif (method_exists($object, 'set' . ucfirst($property))) { |
|
| 92 | - $object->{'set' . ucfirst($property)}($value); |
|
| 91 | + } elseif (method_exists($object, 'set'.ucfirst($property))) { |
|
| 92 | + $object->{'set'.ucfirst($property)}($value); |
|
| 93 | 93 | } elseif (property_exists($object, $property)) { |
| 94 | 94 | $object->$property = $value; |
| 95 | 95 | } |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | public function pushAll(array $items) |
| 197 | 197 | { |
| 198 | 198 | if (!($this->collection instanceof CollectionInterface)) { |
| 199 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 199 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | $this->collection->pushAll($items); |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | public function push($item) |
| 211 | 211 | { |
| 212 | 212 | if (!($this->collection instanceof CollectionInterface)) { |
| 213 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 213 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | $this->collection->push($item); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | public function put($key, $item) |
| 225 | 225 | { |
| 226 | 226 | if (!($this->collection instanceof CollectionInterface)) { |
| 227 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 227 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | $this->collection->put($key, $item); |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | public function get($key, $default = null) |
| 261 | 261 | { |
| 262 | 262 | if (!($this->collection instanceof CollectionInterface)) { |
| 263 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 263 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | return $this->collection->get($key, $default); |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | public function has($key): bool |
| 282 | 282 | { |
| 283 | 283 | if (!($this->collection instanceof CollectionInterface)) { |
| 284 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 284 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | return $this->collection->has($key); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | public function remove($key) |
| 304 | 304 | { |
| 305 | 305 | if (!($this->collection instanceof CollectionInterface)) { |
| 306 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 306 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | $this->collection->remove($key); |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | public function clear() |
| 328 | 328 | { |
| 329 | 329 | if (!($this->collection instanceof CollectionInterface)) { |
| 330 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 330 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | $this->collection->clear(); |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | public function keys(): array |
| 342 | 342 | { |
| 343 | 343 | if (!($this->collection instanceof CollectionInterface)) { |
| 344 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 344 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | return $this->collection->keys(); |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | public function isEmpty(): bool |
| 354 | 354 | { |
| 355 | 355 | if (!($this->collection instanceof CollectionInterface)) { |
| 356 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 356 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | return $this->collection->isEmpty(); |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | public function map($callback) |
| 371 | 371 | { |
| 372 | 372 | if (!($this->collection instanceof CollectionInterface)) { |
| 373 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 373 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | /** @var static<M> $this */ |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | public function filter($callback = null) |
| 386 | 386 | { |
| 387 | 387 | if (!($this->collection instanceof CollectionInterface)) { |
| 388 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 388 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | $this->collection = $this->collection->filter($callback); |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | public function groupBy($groupBy, $mode = PaginatorInterface::GROUPBY) |
| 400 | 400 | { |
| 401 | 401 | if (!($this->collection instanceof CollectionInterface)) { |
| 402 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 402 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | $this->collection = $this->collection->groupBy($groupBy, $mode); |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | public function contains($element): bool |
| 416 | 416 | { |
| 417 | 417 | if (!($this->collection instanceof CollectionInterface)) { |
| 418 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 418 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | return $this->collection->contains($element); |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | public function indexOf($value, $strict = false) |
| 428 | 428 | { |
| 429 | 429 | if (!($this->collection instanceof CollectionInterface)) { |
| 430 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 430 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | return $this->collection->indexOf($value, $strict); |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | public function merge($items) |
| 440 | 440 | { |
| 441 | 441 | if (!($this->collection instanceof CollectionInterface)) { |
| 442 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 442 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | $this->collection = $this->collection->merge($items); |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | public function sort(callable $callback = null) |
| 454 | 454 | { |
| 455 | 455 | if (!($this->collection instanceof CollectionInterface)) { |
| 456 | - throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method ' . __METHOD__); |
|
| 456 | + throw new \LogicException('Collection is not an instance of CollectionInterface. Could not call method '.__METHOD__); |
|
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | $this->collection = $this->collection->sort($callback); |
@@ -204,7 +204,7 @@ |
||
| 204 | 204 | $this->statements['offset'] = null; |
| 205 | 205 | $this->statements['aggregate'] = ['count', $column ?: '*']; |
| 206 | 206 | |
| 207 | - $count = (int)$this->execute()->current()['aggregate']; |
|
| 207 | + $count = (int) $this->execute()->current()['aggregate']; |
|
| 208 | 208 | |
| 209 | 209 | $this->compilerState->invalidate(); |
| 210 | 210 | $this->statements = $statements; |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | return $compiler->compileDelete($this); |
| 102 | 102 | |
| 103 | 103 | default: |
| 104 | - throw new \LogicException('The query ' . static::class . ' do not supports type ' . $type); |
|
| 104 | + throw new \LogicException('The query '.static::class.' do not supports type '.$type); |
|
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | } |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | $this->statements['offset'] = null; |
| 275 | 275 | $this->statements['aggregate'] = ['pagination', $this->getPaginationColumns($column)]; |
| 276 | 276 | |
| 277 | - $count = (int)$this->execute()->current()['aggregate']; |
|
| 277 | + $count = (int) $this->execute()->current()['aggregate']; |
|
| 278 | 278 | |
| 279 | 279 | $this->compilerState->invalidate(['columns', 'orders']); |
| 280 | 280 | $this->statements = $statements; |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | #[ReadOperation] |
| 321 | 321 | public function count(?string $column = null): int |
| 322 | 322 | { |
| 323 | - return (int)$this->aggregate(__FUNCTION__, $column); |
|
| 323 | + return (int) $this->aggregate(__FUNCTION__, $column); |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | /** |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | #[ReadOperation] |
| 330 | 330 | public function avg(?string $column = null): float |
| 331 | 331 | { |
| 332 | - return (float)$this->aggregate(__FUNCTION__, $column); |
|
| 332 | + return (float) $this->aggregate(__FUNCTION__, $column); |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | /** |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | #[ReadOperation] |
| 357 | 357 | public function sum(?string $column = null): float |
| 358 | 358 | { |
| 359 | - return (float)$this->aggregate(__FUNCTION__, $column); |
|
| 359 | + return (float) $this->aggregate(__FUNCTION__, $column); |
|
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | /** |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | # build a regular expression for each parameter |
| 620 | 620 | foreach ($values as $key => $value) { |
| 621 | 621 | if (is_string($key)) { |
| 622 | - $keys[] = '/:' . $key . '/'; |
|
| 622 | + $keys[] = '/:'.$key.'/'; |
|
| 623 | 623 | } else { |
| 624 | 624 | $keys[] = '/[?]/'; |
| 625 | 625 | } |
@@ -635,7 +635,7 @@ |
||
| 635 | 635 | public function field(string $name) |
| 636 | 636 | { |
| 637 | 637 | if (!isset($this->fields[$name])) { |
| 638 | - throw new \RuntimeException('Field ' . $name . ' not found'); |
|
| 638 | + throw new \RuntimeException('Field '.$name.' not found'); |
|
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | $this->current = $name; |