From 0928c855e0b2695dd75efede2fb2de0507aef288 Mon Sep 17 00:00:00 2001 From: Maximilian Graf Schimmelmann Date: Tue, 31 Oct 2023 16:52:59 +0100 Subject: [PATCH] Adapted Phpstan analyse results, applied PHPCS afterwards again to make Interface replacement properly working. --- src/Factory/AdminContextFactory.php | 4 ++-- src/Factory/EntityFactory.php | 4 ++-- src/Factory/FieldFactory.php | 4 ++-- src/Field/Configurator/AssociationConfigurator.php | 3 +-- src/Field/Configurator/CollectionConfigurator.php | 3 +-- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Factory/AdminContextFactory.php b/src/Factory/AdminContextFactory.php index ff7b492d9b..d2f6400403 100644 --- a/src/Factory/AdminContextFactory.php +++ b/src/Factory/AdminContextFactory.php @@ -33,9 +33,9 @@ final class AdminContextFactory implements AdminContextFactoryInterface { private string $cacheDir; private ?TokenStorageInterface $tokenStorage; - private MenuFactory $menuFactory; + private MenuFactoryInterface $menuFactory; private CrudControllerRegistry $crudControllers; - private EntityFactory $entityFactory; + private EntityFactoryInterface $entityFactory; public function __construct( string $cacheDir, diff --git a/src/Factory/EntityFactory.php b/src/Factory/EntityFactory.php index 4cab27c46d..72dcdd75a9 100644 --- a/src/Factory/EntityFactory.php +++ b/src/Factory/EntityFactory.php @@ -24,8 +24,8 @@ */ final class EntityFactory implements EntityFactoryInterface { - private FieldFactory $fieldFactory; - private ActionFactory $actionFactory; + private FieldFactoryInterface $fieldFactory; + private ActionFactoryInterface $actionFactory; private AuthorizationCheckerInterface $authorizationChecker; private ManagerRegistry $doctrine; private EventDispatcherInterface $eventDispatcher; diff --git a/src/Factory/FieldFactory.php b/src/Factory/FieldFactory.php index 7e08d3b0a4..ab9b0f598d 100644 --- a/src/Factory/FieldFactory.php +++ b/src/Factory/FieldFactory.php @@ -58,7 +58,7 @@ final class FieldFactory implements FieldFactoryInterface private AdminContextProvider $adminContextProvider; private AuthorizationCheckerInterface $authorizationChecker; private iterable $fieldConfigurators; - private FormLayoutFactory $fieldLayoutFactory; + private FormLayoutFactoryInterface $fieldLayoutFactory; public function __construct( AdminContextProvider $adminContextProvider, @@ -151,7 +151,7 @@ private function preProcessFields(FieldCollection $fields, EntityDto $entityDto) $guessedFieldFqcn = IdField::class; } else { $doctrinePropertyType = $entityDto->getPropertyMetadata($fieldDto->getProperty())->get('type'); - $guessedFieldFqcn = $this->$doctrineTypeToFieldFqcn[$doctrinePropertyType] ?? null; + $guessedFieldFqcn = $this->doctrineTypeToFieldFqcn[$doctrinePropertyType] ?? null; if (null === $guessedFieldFqcn) { throw new \RuntimeException(sprintf('The Doctrine type of the "%s" field is "%s", which is not supported by EasyAdmin. For Doctrine\'s Custom Mapping Types have a look at EasyAdmin\'s field docs.', $fieldDto->getProperty(), $doctrinePropertyType)); diff --git a/src/Field/Configurator/AssociationConfigurator.php b/src/Field/Configurator/AssociationConfigurator.php index 7c5e9480f9..05ad2dc54f 100644 --- a/src/Field/Configurator/AssociationConfigurator.php +++ b/src/Field/Configurator/AssociationConfigurator.php @@ -13,7 +13,6 @@ use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldConfiguratorInterface; use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto; use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto; -use EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory; use EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactoryInterface; use EasyCorp\Bundle\EasyAdminBundle\Factory\EntityFactoryInterface; use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; @@ -33,7 +32,7 @@ final class AssociationConfigurator implements FieldConfiguratorInterface private EntityFactoryInterface $entityFactory; private AdminUrlGeneratorInterface $adminUrlGenerator; private RequestStack $requestStack; - private ControllerFactory $controllerFactory; + private ControllerFactoryInterface $controllerFactory; public function __construct( EntityFactoryInterface $entityFactory, diff --git a/src/Field/Configurator/CollectionConfigurator.php b/src/Field/Configurator/CollectionConfigurator.php index 37b9a7d250..0cbe62989b 100644 --- a/src/Field/Configurator/CollectionConfigurator.php +++ b/src/Field/Configurator/CollectionConfigurator.php @@ -10,7 +10,6 @@ use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldConfiguratorInterface; use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto; use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto; -use EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory; use EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactoryInterface; use EasyCorp\Bundle\EasyAdminBundle\Factory\EntityFactoryInterface; use EasyCorp\Bundle\EasyAdminBundle\Field\CollectionField; @@ -31,7 +30,7 @@ final class CollectionConfigurator implements FieldConfiguratorInterface { private RequestStack $requestStack; private EntityFactoryInterface $entityFactory; - private ControllerFactory $controllerFactory; + private ControllerFactoryInterface $controllerFactory; public function __construct( RequestStack $requestStack,