Skip to content

Commit

Permalink
Merge pull request #118 from silarhi/app-update
Browse files Browse the repository at this point in the history
upgrade rector and phpstan
  • Loading branch information
guillaume-sainthillier authored Jan 6, 2025
2 parents b5cc5c9 + 4611031 commit 7787ff6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.65",
"phpunit/phpunit": "^10.5.20|^11.1.3",
"phpstan/phpstan": "^1.12.7",
"rector/rector": "^1.2",
"phpstan/phpstan": "^2",
"rector/rector": "^2",
"vimeo/psalm": "^5.26",
"doctrine/data-fixtures": "^2.0",
"symfony/cache": "^7.0"
Expand Down
2 changes: 2 additions & 0 deletions phpstan.dist.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ parameters:
paths:
- src
- tests
ignoreErrors:
- message: "#^Property Silarhi\\\\CursorPagination\\\\Tests\\\\Entity\\\\.*\\:\\:\\$id \\(int\\|null\\) is never assigned int so it can be removed from the property type\\.$#"
1 change: 1 addition & 0 deletions src/Pagination/CursorPagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ final class CursorPagination implements IteratorAggregate, Countable
/** @var array<int|string, mixed> */
private array $afterValues = [];

/** @var int<0, max>|null */
private ?int $nbResults = null;

public function __construct(
Expand Down
5 changes: 4 additions & 1 deletion tests/Pagination/CursorPaginationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,11 @@ private function getSimpleCursorPagination(): CursorPagination
->getRepository(User::class)
->createQueryBuilder('u');

return new CursorPagination($queryBuilder, new OrderConfigurations(
/** @var CursorPagination<User> $pagination */
$pagination = new CursorPagination($queryBuilder, new OrderConfigurations(
new OrderConfiguration('u.id', fn (User $user) => $user->getId()),
), 2);

return $pagination;
}
}

0 comments on commit 7787ff6

Please sign in to comment.