Skip to content

Commit a4eeb8c

Browse files
committed
bug #7101 Allow decoration of AdminContextFactory (ogrosse)
This PR was squashed before being merged into the 4.x branch. Discussion ---------- Allow decoration of AdminContextFactory Allow the decoration of EasyCorp\Bundle\EasyAdminBundle\Router\AdminRouteGenerator When you decorate this class, you have an error because the AdminContextFactory construct need exactly this class and didn't expect the interface instead. This MR replace with the interface, now it's possible to give a decorated class implement the same interface. Commits ------- 7c7f36a Allow decoration of AdminContextFactory
2 parents d8ed224 + 7c7f36a commit a4eeb8c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Factory/AdminContextFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Controller\CrudControllerInterface;
1111
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Controller\DashboardControllerInterface;
1212
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Factory\MenuFactoryInterface;
13+
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Router\AdminRouteGeneratorInterface;
1314
use EasyCorp\Bundle\EasyAdminBundle\Dto\ActionConfigDto;
1415
use EasyCorp\Bundle\EasyAdminBundle\Dto\AssetsDto;
1516
use EasyCorp\Bundle\EasyAdminBundle\Dto\CrudDto;
@@ -20,7 +21,6 @@
2021
use EasyCorp\Bundle\EasyAdminBundle\Dto\SearchDto;
2122
use EasyCorp\Bundle\EasyAdminBundle\Registry\CrudControllerRegistry;
2223
use EasyCorp\Bundle\EasyAdminBundle\Registry\TemplateRegistry;
23-
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminRouteGenerator;
2424
use Symfony\Component\HttpFoundation\Request;
2525
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
2626
use Symfony\Component\Security\Core\User\UserInterface;
@@ -38,9 +38,9 @@ final class AdminContextFactory
3838
private MenuFactoryInterface $menuFactory;
3939
private CrudControllerRegistry $crudControllers;
4040
private EntityFactory $entityFactory;
41-
private AdminRouteGenerator $adminRouteGenerator;
41+
private AdminRouteGeneratorInterface $adminRouteGenerator;
4242

43-
public function __construct(string $buildDir, ?TokenStorageInterface $tokenStorage, MenuFactoryInterface $menuFactory, CrudControllerRegistry $crudControllers, EntityFactory $entityFactory, AdminRouteGenerator $adminRouteGenerator)
43+
public function __construct(string $buildDir, ?TokenStorageInterface $tokenStorage, MenuFactoryInterface $menuFactory, CrudControllerRegistry $crudControllers, EntityFactory $entityFactory, AdminRouteGeneratorInterface $adminRouteGenerator)
4444
{
4545
$this->buildDir = $buildDir;
4646
$this->tokenStorage = $tokenStorage;

0 commit comments

Comments
 (0)