Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Interface for AdminContextProvider and replaced types in injected classes #6088

Open
wants to merge 5 commits into
base: 4.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/ArgumentResolver/AdminContextResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface;
use Symfony\Component\HttpKernel\Controller\ValueResolverInterface;
Expand All @@ -17,7 +18,7 @@ final class AdminContextResolver implements ValueResolverInterface
{
private AdminContextProvider $adminContextProvider;

public function __construct(AdminContextProvider $adminContextProvider)
public function __construct(AdminContextProviderInterface $adminContextProvider)
{
$this->adminContextProvider = $adminContextProvider;
}
Expand All @@ -36,7 +37,7 @@ final class AdminContextResolver implements ArgumentValueResolverInterface
{
private AdminContextProvider $adminContextProvider;

public function __construct(AdminContextProvider $adminContextProvider)
public function __construct(AdminContextProviderInterface $adminContextProvider)
{
$this->adminContextProvider = $adminContextProvider;
}
Expand Down
5 changes: 3 additions & 2 deletions src/ArgumentResolver/BatchActionDtoResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use EasyCorp\Bundle\EasyAdminBundle\Config\Option\EA;
use EasyCorp\Bundle\EasyAdminBundle\Dto\BatchActionDto;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGeneratorInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface;
Expand All @@ -20,7 +21,7 @@ final class BatchActionDtoResolver implements ValueResolverInterface
private AdminContextProvider $adminContextProvider;
private AdminUrlGeneratorInterface $adminUrlGenerator;

public function __construct(AdminContextProvider $adminContextProvider, AdminUrlGeneratorInterface $adminUrlGenerator)
public function __construct(AdminContextProviderInterface $adminContextProvider, AdminUrlGeneratorInterface $adminUrlGenerator)
{
$this->adminContextProvider = $adminContextProvider;
$this->adminUrlGenerator = $adminUrlGenerator;
Expand Down Expand Up @@ -56,7 +57,7 @@ final class BatchActionDtoResolver implements ArgumentValueResolverInterface
private AdminContextProvider $adminContextProvider;
private AdminUrlGeneratorInterface $adminUrlGenerator;

public function __construct(AdminContextProvider $adminContextProvider, AdminUrlGeneratorInterface $adminUrlGenerator)
public function __construct(AdminContextProviderInterface $adminContextProvider, AdminUrlGeneratorInterface $adminUrlGenerator)
{
$this->adminContextProvider = $adminContextProvider;
$this->adminUrlGenerator = $adminUrlGenerator;
Expand Down
3 changes: 2 additions & 1 deletion src/EventListener/CrudResponseListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use EasyCorp\Bundle\EasyAdminBundle\Config\KeyValueStore;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\ViewEvent;
Expand All @@ -17,9 +18,9 @@
private AdminContextProvider $adminContextProvider;
private Environment $twig;

public function __construct(AdminContextProvider $adminContextProvider, Environment $twig)
public function __construct(AdminContextProviderInterface $adminContextProvider, Environment $twig)
{
$this->adminContextProvider = $adminContextProvider;

Check failure on line 23 in src/EventListener/CrudResponseListener.php

View workflow job for this annotation

GitHub Actions / phpstan

Property EasyCorp\Bundle\EasyAdminBundle\EventListener\CrudResponseListener::$adminContextProvider (EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider) does not accept EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface.
$this->twig = $twig;
}

Expand Down
3 changes: 2 additions & 1 deletion src/EventListener/ExceptionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use EasyCorp\Bundle\EasyAdminBundle\Exception\BaseException;
use EasyCorp\Bundle\EasyAdminBundle\Exception\FlattenException;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Twig\Environment;
Expand All @@ -25,10 +26,10 @@
private AdminContextProvider $adminContextProvider;
private Environment $twig;

public function __construct(bool $kernelDebug, AdminContextProvider $adminContextProvider, Environment $twig)
public function __construct(bool $kernelDebug, AdminContextProviderInterface $adminContextProvider, Environment $twig)
{
$this->kernelDebug = $kernelDebug;
$this->adminContextProvider = $adminContextProvider;

Check failure on line 32 in src/EventListener/ExceptionListener.php

View workflow job for this annotation

GitHub Actions / phpstan

Property EasyCorp\Bundle\EasyAdminBundle\EventListener\ExceptionListener::$adminContextProvider (EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider) does not accept EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface.
$this->twig = $twig;
}

Expand Down
3 changes: 2 additions & 1 deletion src/Factory/ActionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use EasyCorp\Bundle\EasyAdminBundle\Dto\ActionDto;
use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGeneratorInterface;
use EasyCorp\Bundle\EasyAdminBundle\Security\Permission;
use EasyCorp\Bundle\EasyAdminBundle\Translation\TranslatableMessageBuilder;
Expand All @@ -29,9 +30,9 @@
private AdminUrlGeneratorInterface $adminUrlGenerator;
private ?CsrfTokenManagerInterface $csrfTokenManager;

public function __construct(AdminContextProvider $adminContextProvider, AuthorizationCheckerInterface $authChecker, AdminUrlGeneratorInterface $adminUrlGenerator, ?CsrfTokenManagerInterface $csrfTokenManager = null)
public function __construct(AdminContextProviderInterface $adminContextProvider, AuthorizationCheckerInterface $authChecker, AdminUrlGeneratorInterface $adminUrlGenerator, ?CsrfTokenManagerInterface $csrfTokenManager = null)
{
$this->adminContextProvider = $adminContextProvider;

Check failure on line 35 in src/Factory/ActionFactory.php

View workflow job for this annotation

GitHub Actions / phpstan

Property EasyCorp\Bundle\EasyAdminBundle\Factory\ActionFactory::$adminContextProvider (EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider) does not accept EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface.
$this->authChecker = $authChecker;
$this->adminUrlGenerator = $adminUrlGenerator;
$this->csrfTokenManager = $csrfTokenManager;
Expand Down
3 changes: 2 additions & 1 deletion src/Factory/FieldFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use EasyCorp\Bundle\EasyAdminBundle\Field\TimeField;
use EasyCorp\Bundle\EasyAdminBundle\Form\Type\EaFormRowType;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;
use EasyCorp\Bundle\EasyAdminBundle\Security\Permission;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;

Expand Down Expand Up @@ -60,9 +61,9 @@
private iterable $fieldConfigurators;
private FormLayoutFactory $fieldLayoutFactory;

public function __construct(AdminContextProvider $adminContextProvider, AuthorizationCheckerInterface $authorizationChecker, iterable $fieldConfigurators, FormLayoutFactory $fieldLayoutFactory)
public function __construct(AdminContextProviderInterface $adminContextProvider, AuthorizationCheckerInterface $authorizationChecker, iterable $fieldConfigurators, FormLayoutFactory $fieldLayoutFactory)
{
$this->adminContextProvider = $adminContextProvider;

Check failure on line 66 in src/Factory/FieldFactory.php

View workflow job for this annotation

GitHub Actions / phpstan

Property EasyCorp\Bundle\EasyAdminBundle\Factory\FieldFactory::$adminContextProvider (EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider) does not accept EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface.
$this->authorizationChecker = $authorizationChecker;
$this->fieldConfigurators = $fieldConfigurators;
$this->fieldLayoutFactory = $fieldLayoutFactory;
Expand Down
3 changes: 2 additions & 1 deletion src/Factory/FilterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use EasyCorp\Bundle\EasyAdminBundle\Filter\NumericFilter;
use EasyCorp\Bundle\EasyAdminBundle\Filter\TextFilter;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;

/**
* @author Yonel Ceruto <yonelceruto@gmail.com>
Expand Down Expand Up @@ -52,9 +53,9 @@
Types::TEXT => TextFilter::class,
];

public function __construct(AdminContextProvider $adminContextProvider, iterable $filterConfigurators)
public function __construct(AdminContextProviderInterface $adminContextProvider, iterable $filterConfigurators)
{
$this->adminContextProvider = $adminContextProvider;

Check failure on line 58 in src/Factory/FilterFactory.php

View workflow job for this annotation

GitHub Actions / phpstan

Property EasyCorp\Bundle\EasyAdminBundle\Factory\FilterFactory::$adminContextProvider (EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider) does not accept EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface.
$this->filterConfigurators = $filterConfigurators;
}

Expand Down
3 changes: 2 additions & 1 deletion src/Factory/MenuFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use EasyCorp\Bundle\EasyAdminBundle\Dto\MenuItemDto;
use EasyCorp\Bundle\EasyAdminBundle\Dto\UserMenuDto;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGeneratorInterface;
use EasyCorp\Bundle\EasyAdminBundle\Security\Permission;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
Expand All @@ -30,9 +31,9 @@
private AdminUrlGeneratorInterface $adminUrlGenerator;
private MenuItemMatcherInterface $menuItemMatcher;

public function __construct(AdminContextProvider $adminContextProvider, AuthorizationCheckerInterface $authChecker, LogoutUrlGenerator $logoutUrlGenerator, AdminUrlGeneratorInterface $adminUrlGenerator, MenuItemMatcherInterface $menuItemMatcher)
public function __construct(AdminContextProviderInterface $adminContextProvider, AuthorizationCheckerInterface $authChecker, LogoutUrlGenerator $logoutUrlGenerator, AdminUrlGeneratorInterface $adminUrlGenerator, MenuItemMatcherInterface $menuItemMatcher)
{
$this->adminContextProvider = $adminContextProvider;

Check failure on line 36 in src/Factory/MenuFactory.php

View workflow job for this annotation

GitHub Actions / phpstan

Property EasyCorp\Bundle\EasyAdminBundle\Factory\MenuFactory::$adminContextProvider (EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider) does not accept EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface.
$this->authChecker = $authChecker;
$this->logoutUrlGenerator = $logoutUrlGenerator;
$this->adminUrlGenerator = $adminUrlGenerator;
Expand Down
3 changes: 2 additions & 1 deletion src/Factory/PaginatorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Doctrine\ORM\QueryBuilder;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Orm\EntityPaginatorInterface;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;

/**
* @author Javier Eguiluz <javier.eguiluz@gmail.com>
Expand All @@ -14,9 +15,9 @@
private AdminContextProvider $adminContextProvider;
bytes-commerce marked this conversation as resolved.
Show resolved Hide resolved
private EntityPaginatorInterface $entityPaginator;

public function __construct(AdminContextProvider $adminContextProvider, EntityPaginatorInterface $entityPaginator)
public function __construct(AdminContextProviderInterface $adminContextProvider, EntityPaginatorInterface $entityPaginator)
{
$this->adminContextProvider = $adminContextProvider;

Check failure on line 20 in src/Factory/PaginatorFactory.php

View workflow job for this annotation

GitHub Actions / phpstan

Property EasyCorp\Bundle\EasyAdminBundle\Factory\PaginatorFactory::$adminContextProvider (EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider) does not accept EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface.
$this->entityPaginator = $entityPaginator;
}

Expand Down
3 changes: 2 additions & 1 deletion src/Field/Configurator/CommonPostConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto;
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;
use function Symfony\Component\String\u;
use Twig\Markup;

Expand All @@ -19,9 +20,9 @@
private AdminContextProvider $adminContextProvider;
bytes-commerce marked this conversation as resolved.
Show resolved Hide resolved
private string $charset;

public function __construct(AdminContextProvider $adminContextProvider, string $charset)
public function __construct(AdminContextProviderInterface $adminContextProvider, string $charset)
{
$this->adminContextProvider = $adminContextProvider;

Check failure on line 25 in src/Field/Configurator/CommonPostConfigurator.php

View workflow job for this annotation

GitHub Actions / phpstan

Property EasyCorp\Bundle\EasyAdminBundle\Field\Configurator\CommonPostConfigurator::$adminContextProvider (EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider) does not accept EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface.
$this->charset = $charset;
}

Expand Down
3 changes: 2 additions & 1 deletion src/Form/Extension/EaCrudFormTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use EasyCorp\Bundle\EasyAdminBundle\Dto\FormVarsDto;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormInterface;
Expand All @@ -20,9 +21,9 @@
{
private AdminContextProvider $adminContextProvider;
bytes-commerce marked this conversation as resolved.
Show resolved Hide resolved

public function __construct(AdminContextProvider $adminContextProvider)
public function __construct(AdminContextProviderInterface $adminContextProvider)
{
$this->adminContextProvider = $adminContextProvider;

Check failure on line 26 in src/Form/Extension/EaCrudFormTypeExtension.php

View workflow job for this annotation

GitHub Actions / phpstan

Property EasyCorp\Bundle\EasyAdminBundle\Form\Extension\EaCrudFormTypeExtension::$adminContextProvider (EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider) does not accept EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface.
}

public function configureOptions(OptionsResolver $resolver): void
Expand Down
3 changes: 2 additions & 1 deletion src/Inspector/DataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use EasyCorp\Bundle\EasyAdminBundle\Config\Option\EA;
use EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\DataCollector as BaseDataCollector;
Expand All @@ -19,9 +20,9 @@
{
private AdminContextProvider $adminContextProvider;
bytes-commerce marked this conversation as resolved.
Show resolved Hide resolved

public function __construct(AdminContextProvider $adminContextProvider)
public function __construct(AdminContextProviderInterface $adminContextProvider)
{
$this->adminContextProvider = $adminContextProvider;

Check failure on line 25 in src/Inspector/DataCollector.php

View workflow job for this annotation

GitHub Actions / phpstan

Property EasyCorp\Bundle\EasyAdminBundle\Inspector\DataCollector::$adminContextProvider (EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider) does not accept EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface.
}

public function reset(): void
Expand Down
3 changes: 2 additions & 1 deletion src/Menu/MenuItemMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Menu\MenuItemMatcherInterface;
use EasyCorp\Bundle\EasyAdminBundle\Dto\MenuItemDto;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;

/**
* @author Javier Eguiluz <javier.eguiluz@gmail.com>
*/
class MenuItemMatcher implements MenuItemMatcherInterface
{
public function __construct(private AdminContextProvider $adminContextProvider)
public function __construct(private AdminContextProviderInterface $adminContextProvider)
{
}

Expand Down
3 changes: 2 additions & 1 deletion src/Orm/EntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use EasyCorp\Bundle\EasyAdminBundle\Factory\FormFactory;
use EasyCorp\Bundle\EasyAdminBundle\Form\Type\ComparisonType;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;
use Symfony\Component\Uid\Ulid;
use Symfony\Component\Uid\Uuid;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
Expand All @@ -35,7 +36,7 @@ final class EntityRepository implements EntityRepositoryInterface
private FormFactory $formFactory;
private EventDispatcherInterface $eventDispatcher;

public function __construct(AdminContextProvider $adminContextProvider, ManagerRegistry $doctrine, EntityFactory $entityFactory, FormFactory $formFactory, EventDispatcherInterface $eventDispatcher)
public function __construct(AdminContextProviderInterface $adminContextProvider, ManagerRegistry $doctrine, EntityFactory $entityFactory, FormFactory $formFactory, EventDispatcherInterface $eventDispatcher)
{
$this->adminContextProvider = $adminContextProvider;
$this->doctrine = $doctrine;
Expand Down
17 changes: 5 additions & 12 deletions src/Provider/AdminContextProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,16 @@
use Symfony\Component\HttpFoundation\RequestStack;

/**
* Inject this in services that need to get the admin context object.
*
* @author Javier Eguiluz <javier.eguiluz@gmail.com>
*/
final class AdminContextProvider
final class AdminContextProvider implements AdminContextProviderInterface
{
private RequestStack $requestStack;

public function __construct(RequestStack $requestStack)
{
$this->requestStack = $requestStack;
}
public function __construct(
private RequestStack $requestStack
) {}

public function getContext(): ?AdminContext
{
$currentRequest = $this->requestStack->getCurrentRequest();

return null !== $currentRequest ? $currentRequest->get(EA::CONTEXT_REQUEST_ATTRIBUTE) : null;
return $this->requestStack->getCurrentRequest()?->get(EA::CONTEXT_REQUEST_ATTRIBUTE);
}
}
16 changes: 16 additions & 0 deletions src/Provider/AdminContextProviderInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace EasyCorp\Bundle\EasyAdminBundle\Provider;


use EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext;

/**
* @author Javier Eguiluz <javier.eguiluz@gmail.com>
bytes-commerce marked this conversation as resolved.
Show resolved Hide resolved
*/
interface AdminContextProviderInterface
{
public function getContext(): ?AdminContext;
}
2 changes: 1 addition & 1 deletion src/Provider/FieldProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class FieldProvider
{
private AdminContextProvider $adminContextProvider;

public function __construct(AdminContextProvider $adminContextProvider)
public function __construct(AdminContextProviderInterface $adminContextProvider)
{
$this->adminContextProvider = $adminContextProvider;
}
Expand Down
3 changes: 2 additions & 1 deletion src/Router/AdminUrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Controller\DashboardControllerInterface;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;
use EasyCorp\Bundle\EasyAdminBundle\Registry\DashboardControllerRegistry;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

Expand All @@ -25,7 +26,7 @@ final class AdminUrlGenerator implements AdminUrlGeneratorInterface
private ?string $currentPageReferrer = null;
private ?string $customPageReferrer = null;

public function __construct(AdminContextProvider $adminContextProvider, UrlGeneratorInterface $urlGenerator, DashboardControllerRegistry $dashboardControllerRegistry)
public function __construct(AdminContextProviderInterface $adminContextProvider, UrlGeneratorInterface $urlGenerator, DashboardControllerRegistry $dashboardControllerRegistry)
{
$this->adminContextProvider = $adminContextProvider;
$this->urlGenerator = $urlGenerator;
Expand Down
3 changes: 2 additions & 1 deletion src/Security/SecurityVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto;
use EasyCorp\Bundle\EasyAdminBundle\Dto\MenuItemDto;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
Expand All @@ -20,7 +21,7 @@ final class SecurityVoter extends Voter
private AuthorizationCheckerInterface $authorizationChecker;
private AdminContextProvider $adminContextProvider;

public function __construct(AuthorizationCheckerInterface $authorizationChecker, AdminContextProvider $adminContextProvider)
public function __construct(AuthorizationCheckerInterface $authorizationChecker, AdminContextProviderInterface $adminContextProvider)
{
$this->authorizationChecker = $authorizationChecker;
$this->adminContextProvider = $adminContextProvider;
Expand Down
3 changes: 2 additions & 1 deletion src/Twig/EasyAdminTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldLayoutDto;
use EasyCorp\Bundle\EasyAdminBundle\Factory\FormLayoutFactory;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider;
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProviderInterface;
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator;
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGeneratorInterface;
use Symfony\Component\DependencyInjection\ServiceLocator;
Expand All @@ -30,7 +31,7 @@ class EasyAdminTwigExtension extends AbstractExtension implements GlobalsInterfa
private AdminContextProvider $adminContextProvider;
private ?CsrfTokenManagerInterface $csrfTokenManager;

public function __construct(ServiceLocator $serviceLocator, AdminContextProvider $adminContextProvider, ?CsrfTokenManagerInterface $csrfTokenManager)
public function __construct(ServiceLocator $serviceLocator, AdminContextProviderInterface $adminContextProvider, ?CsrfTokenManagerInterface $csrfTokenManager)
{
$this->serviceLocator = $serviceLocator;
$this->adminContextProvider = $adminContextProvider;
Expand Down
Loading