EasyCorp / EasyAdminBundle

EasyAdmin is a fast, beautiful and modern admin generator for Symfony applications.
MIT License
3.99k stars 1.01k forks source link

Use AdminUrlGeneratorInterface instead of AdminUrlGenerator directly #6248

Open jakubciszak opened 1 month ago

jakubciszak commented 1 month ago

Short description of what this feature will allow to do:

Class AdminUrlGenerator is marked as final, so there are no possibility to override any functionality. There is a AdminUrlGeneratorInterface in code, but many places use class instead of interface in arguments declaration. This is design fault. If we have Interface, every place should referring to interface, especially when base class is final.

Example of how to use this feature


<?php 

#[AsDecorator(decorates: AdminUrlGeneratorDecorator::class)]
class AdminUrlGeneratorDecorator implements AdminUrlGeneratorInterface
{

    public function __construct(private AdminUrlGeneratorInterface $decorated)
    {
    }

 // Decorate generateUrl for example 
alexndlm commented 4 weeks ago

Is you ask about https://github.com/EasyCorp/EasyAdminBundle/releases/tag/v4.8.1