EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

Use AdminUrlGeneratorInterface instead of AdminUrlGenerator directly

Open jakubciszak opened this issue 1 year ago • 2 comments

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 

jakubciszak avatar Apr 08 '24 15:04 jakubciszak

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

alexndlm avatar Apr 18 '24 11:04 alexndlm

Hey @jakubciszak

Is it still missing use AdminUrlGeneratorInterface anywhere?

eerison avatar Oct 04 '24 19:10 eerison