@return void
*/
protected function loadAuthenticationMiddleware(MiddlewareQueue $middlewareQueue, AuthenticationServiceProviderInterface $serviceProvider)
{
///make my middleware with my own service provider
}
What you expected to happen
I expected to be able to pass my own AuthenticationServiceProviderInterface on AuthorizationServiceProviderInterface and was not able to do so.
What I tried doesn't work because of course you can't change the type hints in strict mode. What would be nice is if this class were changed to use the interfaces on the Plugin class instead of the concretion -- Plugin. So I can overload these methods with my own code.
I would propose to make two classes that do what the plugin is doing and pass those in to the MiddlewareQueueLoader and remove the code from the Plugin class.
I consider this a bug, because interfaces were made but not used where they really would have been useful.
This is a (multiple allowed):
[x] bug
[] enhancement
[ ] feature-discussion (RFC)
CakeDC Users Version:
Platform and Target: PHP
What you did
I created a class that extended MiddlewareQueueLoader. So I could overload the loadAuthenticationMiddleware method.
What happened
I was not able to extend the class because what I tried to overload was this:
/**
What you expected to happen
I expected to be able to pass my own AuthenticationServiceProviderInterface on AuthorizationServiceProviderInterface and was not able to do so.
What I tried doesn't work because of course you can't change the type hints in strict mode. What would be nice is if this class were changed to use the interfaces on the Plugin class instead of the concretion -- Plugin. So I can overload these methods with my own code.
I would propose to make two classes that do what the plugin is doing and pass those in to the MiddlewareQueueLoader and remove the code from the Plugin class.
I consider this a bug, because interfaces were made but not used where they really would have been useful.