assets
assets copied to clipboard
Notify client about incorrect AssetManager::asset usage
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.