From 0a528f883d3fc2b0c0ff90fd700105683397a02a Mon Sep 17 00:00:00 2001 From: Maximilian Graf Schimmelmann Date: Sun, 3 Sep 2023 16:42:23 +0200 Subject: [PATCH] Replaced PhpStan declarations. --- src/ArgumentResolver/AdminContextResolver.php | 2 +- src/ArgumentResolver/BatchActionDtoResolver.php | 4 ++-- src/Collection/ActionCollection.php | 14 +++++++++----- src/Collection/EntityCollection.php | 2 +- src/Collection/FieldCollection.php | 2 +- src/Collection/FilterCollection.php | 2 +- src/Dto/ActionConfigDto.php | 2 +- src/Factory/FormFactory.php | 1 - 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/ArgumentResolver/AdminContextResolver.php b/src/ArgumentResolver/AdminContextResolver.php index cb5b90af27..f042a773da 100644 --- a/src/ArgumentResolver/AdminContextResolver.php +++ b/src/ArgumentResolver/AdminContextResolver.php @@ -35,7 +35,7 @@ public function resolve(Request $request, ArgumentMetadata $argument): iterable } else { final class AdminContextResolver implements ArgumentValueResolverInterface { - private AdminContextProvider $adminContextProvider; + private AdminContextProviderInterface $adminContextProvider; public function __construct(AdminContextProviderInterface $adminContextProvider) { diff --git a/src/ArgumentResolver/BatchActionDtoResolver.php b/src/ArgumentResolver/BatchActionDtoResolver.php index 5a1ef1f8fb..969c329a36 100644 --- a/src/ArgumentResolver/BatchActionDtoResolver.php +++ b/src/ArgumentResolver/BatchActionDtoResolver.php @@ -56,8 +56,8 @@ public function resolve(Request $request, ArgumentMetadata $argument): iterable } else { final class BatchActionDtoResolver implements ArgumentValueResolverInterface { - private AdminContextProvider $adminContextProvider; - private AdminUrlGenerator $adminUrlGenerator; + private AdminContextProviderInterface $adminContextProvider; + private AdminUrlGeneratorInterface $adminUrlGenerator; public function __construct(AdminContextProviderInterface $adminContextProvider, AdminUrlGeneratorInterface $adminUrlGenerator) { diff --git a/src/Collection/ActionCollection.php b/src/Collection/ActionCollection.php index 5946ae5ec1..f6d38d603b 100644 --- a/src/Collection/ActionCollection.php +++ b/src/Collection/ActionCollection.php @@ -2,10 +2,14 @@ namespace EasyCorp\Bundle\EasyAdminBundle\Collection; +use ArrayIterator; use EasyCorp\Bundle\EasyAdminBundle\Contracts\Collection\CollectionInterface; use EasyCorp\Bundle\EasyAdminBundle\Dto\ActionDto; use EasyCorp\Bundle\EasyAdminBundle\Dto\ActionDtoInterface; +use function array_key_exists; +use function count; + /** * @author Javier Eguiluz */ @@ -48,7 +52,7 @@ public function get(string $actionName): ?ActionDtoInterface public function offsetExists(mixed $offset): bool { - return \array_key_exists($offset, $this->actions); + return array_key_exists($offset, $this->actions); } public function offsetGet(mixed $offset): ActionDtoInterface @@ -68,15 +72,15 @@ public function offsetUnset(mixed $offset): void public function count(): int { - return \count($this->actions); + return count($this->actions); } /** - * @return \ArrayIterator + * @return ArrayIterator */ - public function getIterator(): \ArrayIterator + public function getIterator(): ArrayIterator { - return new \ArrayIterator($this->actions); + return new ArrayIterator($this->actions); } public function getEntityActions(): self diff --git a/src/Collection/EntityCollection.php b/src/Collection/EntityCollection.php index 23ebab6ddf..1c6eea70bb 100644 --- a/src/Collection/EntityCollection.php +++ b/src/Collection/EntityCollection.php @@ -62,7 +62,7 @@ public function count(): int } /** - * @return \ArrayIterator + * @return \ArrayIterator */ public function getIterator(): \ArrayIterator { diff --git a/src/Collection/FieldCollection.php b/src/Collection/FieldCollection.php index 318e91e218..612ee8898c 100644 --- a/src/Collection/FieldCollection.php +++ b/src/Collection/FieldCollection.php @@ -119,7 +119,7 @@ public function count(): int } /** - * @return \ArrayIterator + * @return \ArrayIterator */ public function getIterator(): \ArrayIterator { diff --git a/src/Collection/FilterCollection.php b/src/Collection/FilterCollection.php index d10d8b45ca..4f0961864d 100644 --- a/src/Collection/FilterCollection.php +++ b/src/Collection/FilterCollection.php @@ -65,7 +65,7 @@ public function count(): int } /** - * @return \ArrayIterator + * @return \ArrayIterator */ public function getIterator(): \ArrayIterator { diff --git a/src/Dto/ActionConfigDto.php b/src/Dto/ActionConfigDto.php index 0275c78642..a142afc14f 100644 --- a/src/Dto/ActionConfigDto.php +++ b/src/Dto/ActionConfigDto.php @@ -10,7 +10,7 @@ final class ActionConfigDto implements ActionConfigDtoInterface { private ?string $pageName = null; /** - * @var array> + * @var array> */ private array $actions = [ CrudInterface::PAGE_DETAIL => [], diff --git a/src/Factory/FormFactory.php b/src/Factory/FormFactory.php index 5c0677085f..9b82f14475 100644 --- a/src/Factory/FormFactory.php +++ b/src/Factory/FormFactory.php @@ -6,7 +6,6 @@ use EasyCorp\Bundle\EasyAdminBundle\Config\KeyValueStore; use EasyCorp\Bundle\EasyAdminBundle\Config\Option\EA; use EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext; -use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto; use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDtoInterface; use EasyCorp\Bundle\EasyAdminBundle\Form\Type\CrudFormType; use EasyCorp\Bundle\EasyAdminBundle\Form\Type\FiltersFormType;