diff --git a/composer.json b/composer.json index 73054b40..e5acb550 100644 --- a/composer.json +++ b/composer.json @@ -57,7 +57,7 @@ "lchrusciel/api-test-case": "^5.0", "matthiasnoback/symfony-config-test": "^4.2.1", "matthiasnoback/symfony-dependency-injection-test": "^4.2.1", - "pagerfanta/pagerfanta": "^1.1 || ^2.5", + "pagerfanta/pagerfanta": "^3.0", "pamil/phpspec-skip-example-extension": "^4.2", "phpspec/phpspec": "^7.0", "phpstan/phpstan": "0.12.99", @@ -65,7 +65,7 @@ "phpstan/phpstan-webmozart-assert": "0.12.16", "phpunit/phpunit": "^9.5", "sylius-labs/coding-standard": "^4.0", - "sylius/resource-bundle": "^1.8", + "sylius/resource-bundle": "^1.9", "symfony/console": "^4.4 || ^5.4", "symfony/dotenv": "^4.4 || ^5.4", "symfony/polyfill-mbstring": "<1.22.0 || >1.22.0", @@ -120,5 +120,7 @@ "test-with-postgres": [ "APP_ENV=test_with_postgres vendor/bin/phpunit --colors=always" ] - } + }, + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/src/Bundle/Doctrine/DBAL/DataSource.php b/src/Bundle/Doctrine/DBAL/DataSource.php index 54cce408..9a80a42f 100644 --- a/src/Bundle/Doctrine/DBAL/DataSource.php +++ b/src/Bundle/Doctrine/DBAL/DataSource.php @@ -14,7 +14,7 @@ namespace Sylius\Bundle\GridBundle\Doctrine\DBAL; use Doctrine\DBAL\Query\QueryBuilder; -use Pagerfanta\Adapter\DoctrineDbalAdapter; +use Pagerfanta\Doctrine\DBAL\QueryAdapter;; use Pagerfanta\Pagerfanta; use Sylius\Component\Grid\Data\DataSourceInterface; use Sylius\Component\Grid\Data\ExpressionBuilderInterface; @@ -60,7 +60,7 @@ public function getData(Parameters $parameters) ; }; - $paginator = new Pagerfanta(new DoctrineDbalAdapter($this->queryBuilder, $countQueryBuilderModifier)); + $paginator = new Pagerfanta(new QueryAdapter($this->queryBuilder, $countQueryBuilderModifier)); $paginator->setNormalizeOutOfRangePages(true); $paginator->setCurrentPage($parameters->get('page', 1)); diff --git a/src/Bundle/Doctrine/ORM/DataSource.php b/src/Bundle/Doctrine/ORM/DataSource.php index aa1f50b1..a700b43b 100644 --- a/src/Bundle/Doctrine/ORM/DataSource.php +++ b/src/Bundle/Doctrine/ORM/DataSource.php @@ -14,7 +14,7 @@ namespace Sylius\Bundle\GridBundle\Doctrine\ORM; use Doctrine\ORM\QueryBuilder; -use Pagerfanta\Adapter\DoctrineORMAdapter; +use Pagerfanta\Doctrine\ORM\QueryAdapter; use Pagerfanta\Pagerfanta; use Sylius\Component\Grid\Data\DataSourceInterface; use Sylius\Component\Grid\Data\ExpressionBuilderInterface; @@ -68,7 +68,7 @@ public function getExpressionBuilder(): ExpressionBuilderInterface public function getData(Parameters $parameters) { $paginator = new Pagerfanta( - new DoctrineORMAdapter($this->queryBuilder, $this->fetchJoinCollection, $this->useOutputWalkers) + new QueryAdapter($this->queryBuilder, $this->fetchJoinCollection, $this->useOutputWalkers) ); $paginator->setNormalizeOutOfRangePages(true); $paginator->setCurrentPage($parameters->get('page', 1)); diff --git a/src/Bundle/Doctrine/PHPCRODM/DataSource.php b/src/Bundle/Doctrine/PHPCRODM/DataSource.php index 8b20068d..4816c23f 100644 --- a/src/Bundle/Doctrine/PHPCRODM/DataSource.php +++ b/src/Bundle/Doctrine/PHPCRODM/DataSource.php @@ -14,7 +14,7 @@ namespace Sylius\Bundle\GridBundle\Doctrine\PHPCRODM; use Doctrine\ODM\PHPCR\Query\Builder\QueryBuilder; -use Pagerfanta\Adapter\DoctrineODMPhpcrAdapter; +use Pagerfanta\Doctrine\PHPCRODM\QueryAdapter; use Pagerfanta\Pagerfanta; use Sylius\Component\Grid\Data\DataSourceInterface; use Sylius\Component\Grid\Data\ExpressionBuilderInterface; @@ -75,7 +75,7 @@ public function getData(Parameters $parameters) $orderBy->{$direction}()->field(sprintf('%s.%s', Driver::QB_SOURCE_ALIAS, $field)); } - $paginator = new Pagerfanta(new DoctrineODMPhpcrAdapter($this->queryBuilder)); + $paginator = new Pagerfanta(new QueryAdapter($this->queryBuilder)); $paginator->setCurrentPage($parameters->get('page', 1)); return $paginator;