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

Notify client about incorrect AssetManager::asset usage #36

Open
shvlv opened this issue Aug 12, 2021 · 0 comments
Open

Notify client about incorrect AssetManager::asset usage #36

shvlv opened this issue Aug 12, 2021 · 0 comments

Comments

@shvlv
Copy link
Contributor

shvlv commented Aug 12, 2021

Is your feature request related to a problem? Please describe.
I used the AssetManager::asset method to update assets loaded by EncoreEntrypointsLoader but stumbled on the following behavior. When the client doesn't provide second param and assets storage includes several assets shared the same handle (style and script in my case) method silently returns null.

Describe the solution you'd like
Throws LogicException from https://github.com/inpsyde/assets/blob/master/src/AssetManager.php#L171 point with a clear description of what will be wrong. Something like: We found 2 assets with the same handle: %s. Are you forgot to provide $type argument?

Describe alternatives you've considered
Improve documentation.

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

1 participant