@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | |
| 352 | 352 | $config ??= []; |
| 353 | 353 | |
| 354 | - return array_filter($config, static function (mixed $value, string $key) use ($validKeys): bool { |
|
| 354 | + return array_filter($config, static function(mixed $value, string $key) use ($validKeys): bool { |
|
| 355 | 355 | if (!in_array($key, $validKeys, true)) { |
| 356 | 356 | return false; |
| 357 | 357 | } |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | return $this->beforeQueryCallback; |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | - return static function (): void {}; |
|
| 379 | + return static function(): void {}; |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | /** |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | return $this->afterQueryCallback; |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | - return static function (): void {}; |
|
| 394 | + return static function(): void {}; |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | /** |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | ->setItemsPerPage(10) |
| 124 | 124 | ->setPagesInRange(5); |
| 125 | 125 | |
| 126 | - $paginator->setItemTotalCallback(static function (): int { |
|
| 126 | + $paginator->setItemTotalCallback(static function(): int { |
|
| 127 | 127 | /** @var PDOStatement $result */ |
| 128 | 128 | $result = self::$dbObj->query("SELECT COUNT(*) as totalCount FROM facts"); |
| 129 | 129 | $row = $result->fetchColumn(); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | }); |
| 132 | 132 | |
| 133 | 133 | // Pass our slice callback. |
| 134 | - $paginator->setSliceCallback(static function (int $offset, int $length): array { |
|
| 134 | + $paginator->setSliceCallback(static function(int $offset, int $length): array { |
|
| 135 | 135 | /** @var PDOStatement $result */ |
| 136 | 136 | $result = self::$dbObj->query(sprintf('SELECT name, area FROM facts ORDER BY area DESC LIMIT %d, %d', $offset, $length), PDO::FETCH_ASSOC); |
| 137 | 137 | $collection = []; |
@@ -366,12 +366,12 @@ discard block |
||
| 366 | 366 | ]); |
| 367 | 367 | |
| 368 | 368 | $beforeQueryFired = false; |
| 369 | - $paginator->setBeforeQueryCallback(static function () use (&$beforeQueryFired): void { |
|
| 369 | + $paginator->setBeforeQueryCallback(static function() use (&$beforeQueryFired): void { |
|
| 370 | 370 | $beforeQueryFired = true; |
| 371 | 371 | }); |
| 372 | 372 | |
| 373 | 373 | $afterQueryFired = false; |
| 374 | - $paginator->setAfterQueryCallback(static function () use (&$afterQueryFired): void { |
|
| 374 | + $paginator->setAfterQueryCallback(static function() use (&$afterQueryFired): void { |
|
| 375 | 375 | $afterQueryFired = true; |
| 376 | 376 | }); |
| 377 | 377 | |
@@ -394,12 +394,12 @@ discard block |
||
| 394 | 394 | ]); |
| 395 | 395 | |
| 396 | 396 | $beforeQueryFired = false; |
| 397 | - $paginator->setBeforeQueryCallback(static function () use (&$beforeQueryFired): void { |
|
| 397 | + $paginator->setBeforeQueryCallback(static function() use (&$beforeQueryFired): void { |
|
| 398 | 398 | $beforeQueryFired = true; |
| 399 | 399 | }); |
| 400 | 400 | |
| 401 | 401 | $afterQueryFired = false; |
| 402 | - $paginator->setAfterQueryCallback(static function () use (&$afterQueryFired): void { |
|
| 402 | + $paginator->setAfterQueryCallback(static function() use (&$afterQueryFired): void { |
|
| 403 | 403 | $afterQueryFired = true; |
| 404 | 404 | }); |
| 405 | 405 | |
@@ -519,13 +519,13 @@ discard block |
||
| 519 | 519 | |
| 520 | 520 | $this->paginator->setItemsPerPage(10)->setPagesInRange(5); |
| 521 | 521 | |
| 522 | - $this->paginator->setItemTotalCallback(static function (Pagination $pagination) use ($items): int { |
|
| 522 | + $this->paginator->setItemTotalCallback(static function(Pagination $pagination) use ($items): int { |
|
| 523 | 523 | $pagination->setMeta(['meta_1']); |
| 524 | 524 | |
| 525 | 525 | return count($items); |
| 526 | 526 | }); |
| 527 | 527 | |
| 528 | - $this->paginator->setSliceCallback(static function (int $offset, int $length, Pagination $pagination) use ($items): array { |
|
| 528 | + $this->paginator->setSliceCallback(static function(int $offset, int $length, Pagination $pagination) use ($items): array { |
|
| 529 | 529 | $pagination->setMeta(array_merge($pagination->getMeta(), ['meta_2'])); |
| 530 | 530 | |
| 531 | 531 | return array_slice($items, $offset, $length); |
@@ -598,13 +598,13 @@ discard block |
||
| 598 | 598 | |
| 599 | 599 | $this->paginator->setItemsPerPage(10)->setPagesInRange(5); |
| 600 | 600 | |
| 601 | - $this->paginator->setItemTotalCallback(static function (Pagination $pagination) use ($items): int { |
|
| 601 | + $this->paginator->setItemTotalCallback(static function(Pagination $pagination) use ($items): int { |
|
| 602 | 602 | $pagination->setMeta(['meta_3']); |
| 603 | 603 | |
| 604 | 604 | return count($items); |
| 605 | 605 | }); |
| 606 | 606 | |
| 607 | - $this->paginator->setSliceCallback(static function (int $offset, int $length, Pagination $pagination) use ($items): array { |
|
| 607 | + $this->paginator->setSliceCallback(static function(int $offset, int $length, Pagination $pagination) use ($items): array { |
|
| 608 | 608 | $pagination->setMeta(array_merge($pagination->getMeta(), ['meta_4'])); |
| 609 | 609 | |
| 610 | 610 | return array_slice($items, $offset, $length); |
@@ -677,13 +677,13 @@ discard block |
||
| 677 | 677 | |
| 678 | 678 | $this->paginator->setItemsPerPage(-1)->setPagesInRange(5); |
| 679 | 679 | |
| 680 | - $this->paginator->setItemTotalCallback(static function (Pagination $pagination) use ($items): int { |
|
| 680 | + $this->paginator->setItemTotalCallback(static function(Pagination $pagination) use ($items): int { |
|
| 681 | 681 | $pagination->setMeta(['meta_3']); |
| 682 | 682 | |
| 683 | 683 | return count($items); |
| 684 | 684 | }); |
| 685 | 685 | |
| 686 | - $this->paginator->setSliceCallback(static function (int $offset, int $length, Pagination $pagination) use ($items): array { |
|
| 686 | + $this->paginator->setSliceCallback(static function(int $offset, int $length, Pagination $pagination) use ($items): array { |
|
| 687 | 687 | $pagination->setMeta(array_merge($pagination->getMeta(), ['meta_4'])); |
| 688 | 688 | |
| 689 | 689 | return array_slice($items, $offset, $length); |