From 4e544f2824e5df5246aa7869032665eb9e92c373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Fr=C3=A9mont?= Date: Thu, 28 Jul 2022 14:01:38 +0200 Subject: [PATCH 1/2] Trying to fix the build --- src/Component/Repository/InMemoryRepository.php | 4 ++++ src/Component/Repository/RepositoryInterface.php | 1 + 2 files changed, 5 insertions(+) diff --git a/src/Component/Repository/InMemoryRepository.php b/src/Component/Repository/InMemoryRepository.php index 4735cce28..429764a75 100644 --- a/src/Component/Repository/InMemoryRepository.php +++ b/src/Component/Repository/InMemoryRepository.php @@ -16,6 +16,7 @@ use ArrayObject; use Pagerfanta\Adapter\ArrayAdapter; use Pagerfanta\Pagerfanta; +use Pagerfanta\PagerfantaInterface; use Sylius\Component\Resource\Exception\UnexpectedTypeException; use Sylius\Component\Resource\Model\ResourceInterface; use Sylius\Component\Resource\Repository\Exception\ExistingResourceException; @@ -132,6 +133,9 @@ public function getClassName(): string return $this->interface; } + /** + * @return PagerfantaInterface + */ public function createPaginator(array $criteria = [], array $sorting = []): iterable { $resources = $this->findAll(); diff --git a/src/Component/Repository/RepositoryInterface.php b/src/Component/Repository/RepositoryInterface.php index 84d263877..b05e486ac 100644 --- a/src/Component/Repository/RepositoryInterface.php +++ b/src/Component/Repository/RepositoryInterface.php @@ -29,6 +29,7 @@ interface RepositoryInterface extends ObjectRepository /** * @param array $criteria * @param array $sorting + * * @return iterable */ public function createPaginator(array $criteria = [], array $sorting = []): iterable; From 1ce6b3ec4974847be83fce5e341ba2020ac8cd6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Fr=C3=A9mont?= Date: Thu, 28 Jul 2022 14:19:13 +0200 Subject: [PATCH 2/2] Fix Psalm errors --- psalm.xml | 19 +++++++++++++++++++ .../Doctrine/ORM/ResourceRepositoryTrait.php | 3 +++ 2 files changed, 22 insertions(+) diff --git a/psalm.xml b/psalm.xml index eb1cd96ea..f69905fdc 100644 --- a/psalm.xml +++ b/psalm.xml @@ -68,10 +68,29 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/Bundle/Doctrine/ORM/ResourceRepositoryTrait.php b/src/Bundle/Doctrine/ORM/ResourceRepositoryTrait.php index 1511bcbf4..525a9bd31 100644 --- a/src/Bundle/Doctrine/ORM/ResourceRepositoryTrait.php +++ b/src/Bundle/Doctrine/ORM/ResourceRepositoryTrait.php @@ -44,6 +44,9 @@ public function remove(ResourceInterface $resource): void } } + /** + * @return iterable + */ public function createPaginator(array $criteria = [], array $sorting = []): iterable { $queryBuilder = $this->createQueryBuilder('o');