Closed mpoiriert closed 2 years ago
@VincentLanglet You should check this one as well before releasing. It's easy to fix I just want to make sure it will be accepted.
Behaviour of the Admin Fetcher is not base on the specific class so calling it manually it a controller would work that why I was expecting the AdminValueResolver to work the same way.
Sure, feel free to do a PR (with a test will be great) and I'll approve
Subject
When typing argument with the admin interface instead of the exact admin type the admin is not found.
Code example
How to fix
This is because the is_subclass_of function use in AdminValueResolver does check if the class is the same as requested. Also the is_a function have a different behaviour base on a class string or an object, probably a bug in PHP, so it cannot be use of the first check.
Recommendation would be the check if $type === AdminInterface::class or is_subclass_of.