symfony / webpack-encore-bundle

Symfony integration with Webpack Encore!
https://symfony.com/webpack-encore
MIT License
937 stars 83 forks source link

Add `entryExists` to EntrypointLookupInterface #167

Open lcharette opened 2 years ago

lcharette commented 2 years ago

I don't know why it was proposed in #147 not to include entryExists in EntrypointLookupInterface, but it doesn't makes sense to test agains't a specific class instead of the interface.

In my case, this cause an issue as I cannot use dependence injection on EntrypointLookupInterface and expect entryExists to be present.

If this is not approved, I suggest adding entryExists to it's own interface and have EntrypointLookup implement both (although you won't fix the dependency injection problem).

weaverryan commented 2 years ago

Sorry for the slow reply. Not breaking BC was the reason behind not adding it to the interface, which I agree is a bit awkward. We have two choices:

A) Add a 2nd interface as you suggested B) Add the new method to the interface in a BC-friendly way (this includes documenting the new method on the interface, then we would actually make it a real method in the next major version - the UserInterface::getUserIdentifier() is an example of doing that - https://github.com/symfony/symfony/blob/1b57d282713423be349104fd2c9786c9eda2fc38/src/Symfony/Component/Security/Core/User/UserInterface.php#L29

So, we can't merge this PR - but I'd welcome a PR with either of these approaches.

Cheers!