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

Use AdminUrlGeneratorInterface instead of AdminUrlGenerator directly #6248

Open
jakubciszak opened this issue Apr 8, 2024 · 1 comment
Open

Comments

@jakubciszak
Copy link

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
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants