Skip to content

Commit

Permalink
Adapted Phpstan analyse results, applied PHPCS afterwards again to ma…
Browse files Browse the repository at this point in the history
…ke Interface replacement properly working.
  • Loading branch information
bytes-commerce committed Oct 31, 2023
1 parent 8dc9619 commit 0928c85
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Factory/AdminContextFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/Factory/EntityFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/Factory/FieldFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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));
Expand Down
3 changes: 1 addition & 2 deletions src/Field/Configurator/AssociationConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions src/Field/Configurator/CollectionConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit 0928c85

Please sign in to comment.