Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Pagerfanta from 2.x to 3.x #381

Merged
merged 6 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
],
"require": {
"php": "^7.4 || ^8.0",
"babdev/pagerfanta-bundle": "^2.5",
"babdev/pagerfanta-bundle": "^3.0",
"doctrine/collections": "^1.6",
"doctrine/doctrine-bundle": "^1.12 || ^2.0",
"doctrine/event-manager": "^1.1",
Expand Down Expand Up @@ -56,6 +56,7 @@
"doctrine/orm": "^2.5",
"lchrusciel/api-test-case": "^5.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.2.1",
"pagerfanta/pagerfanta": "^3.0",
"pamil/phpspec-skip-example-extension": "^4.2",
"phpspec/phpspec": "^7.2",
"phpspec/prophecy-phpunit": "^2.0",
Expand Down
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ parameters:
- '/Method Sylius\\Component\\Resource\\Model\\TimestampableInterface::setCreatedAt\(\) has no return typehint specified./'
- '/Method Sylius\\Component\\Resource\\Model\\TimestampableInterface::setUpdatedAt\(\) has no return typehint specified./'
- '/Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) invoked with 2 parameters, 1 required\./'
- '/Parameter \#1 \$currentPage of method Pagerfanta\\Pagerfanta<mixed>::setCurrentPage\(\) expects int<1, max>, int given\./'
- '/Parameter \#1 \$maxPerPage of method Pagerfanta\\Pagerfanta<mixed>::setMaxPerPage\(\) expects int<1, max>, int given\./'
- '/Parameter \#1 \$array[0-9]? of function array_multisort expects array, array\|int given\./'
- '/Parameter \#2 \$class of static method Webmozart\\Assert\\Assert::isInstanceOf\(\) expects class-string<object>, string given./'
- '/Unable to resolve the template type ExpectedType in call to method static method Webmozart\\Assert\\Assert::isInstanceOf\(\)/'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace Sylius\Bundle\ResourceBundle\Tests\DependencyInjection\Compiler;

use BabDev\PagerfantaBundle\Twig\PagerfantaExtension;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
use Pagerfanta\Twig\Extension\PagerfantaExtension;
use Pagerfanta\View\ViewFactory;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\PagerfantaBridgePass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function it_handles_Pagerfanta(

$paginator->setMaxPerPage(5)->shouldBeCalled();
$paginator->setCurrentPage(6)->shouldBeCalled();
$paginator->getCurrentPageResults()->shouldBeCalled();
$paginator->getCurrentPageResults()->willReturn([]);

$this->get($requestConfiguration, $repository)->shouldReturn($paginator);
}
Expand Down Expand Up @@ -109,7 +109,7 @@ function it_restricts_max_pagination_limit_based_on_grid_configuration(

$paginator->setMaxPerPage(99)->shouldBeCalled();
$paginator->setCurrentPage(1)->shouldBeCalled();
$paginator->getCurrentPageResults()->shouldBeCalled();
$paginator->getCurrentPageResults()->willReturn([]);

$this->get($requestConfiguration, $repository)->shouldReturn($gridView);
}
Expand Down Expand Up @@ -143,7 +143,7 @@ function it_creates_a_paginated_representation_for_pagerfanta_for_non_html_reque

$paginator->setMaxPerPage(8)->shouldBeCalled();
$paginator->setCurrentPage(6)->shouldBeCalled();
$paginator->getCurrentPageResults()->shouldBeCalled();
$paginator->getCurrentPageResults()->willReturn([]);

$pagerfantaRepresentationFactory->createRepresentation($paginator, Argument::type(Route::class))->willReturn($paginatedRepresentation);

Expand Down Expand Up @@ -177,7 +177,7 @@ function it_handles_resource_grid_view(

$paginator->setMaxPerPage(5)->shouldBeCalled();
$paginator->setCurrentPage(6)->shouldBeCalled();
$paginator->getCurrentPageResults()->shouldBeCalled();
$paginator->getCurrentPageResults()->willReturn([]);

$this->get($requestConfiguration, $repository)->shouldReturn($resourceGridView);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Component/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"doctrine/collections": "^1.6",
"doctrine/inflector": "^1.4 || ^2.0",
"gedmo/doctrine-extensions": "^2.4.12 || ^3.0",
"pagerfanta/core": "^2.4",
"pagerfanta/core": "^3.0",
"symfony/event-dispatcher": "^4.4 || ^5.2",
"symfony/property-access": "^4.4 || ^5.2",
"winzou/state-machine": "^0.4"
Expand Down