EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

fix: get controllers fqcn for route load

Open IndraGunawan opened this issue 9 months ago • 0 comments

fixes #6509

current behaviour: injecting tagged_iterator to AdminRouteGenerator while it only needs the controller class fqcn, make it initialize all the controllers (https://github.com/EasyCorp/EasyAdminBundle/issues/6509#issuecomment-2459872219)

example controller

class BookCrudController extends AbstractCrudController
{
    public function __construct(
        #[Autowire(env: 'NOT_EXISTS')]
        private string $notExistsEnv,
    ) {
    }

    public static function getEntityFqcn(): string
    {
        return Book::class;
    }

    public function configureFields(string $pageName): iterable
    {
        return [
            TextField::new('title'),
            BooleanField::new('isPublished'),
        ];
    }
}

proposed solution: use CompilerPass to get all class fqcn

IndraGunawan avatar Mar 27 '25 06:03 IndraGunawan