laminas-router
laminas-router copied to clipboard
Laminas\I18n\Translator is a soft dependency
Bug Report
When doing an class_implements for Laminas\Router\Http\TranslatorAwareTreeRouteStack
Error: Interface "Laminas\I18n\Translator\TranslatorAwareInterface" not found
Q | A |
---|---|
Version(s) | 3.12.0 |
Summary
Current behavior
How to reproduce
require this package try class_implements for Laminas\Router\Http\TranslatorAwareTreeRouteStack (interface doesnt matter) error occues
Expected behavior
Interface should exists by adding a depencency to this package
This is an optional dependency. It won't be added as direct requirement.
You got same answer in https://github.com/laminas/laminas-validator/issues/220
We no longer allow optional dependencies to be added, however they would remain optional until they removed by a next major release.
This error still exists.
That doesn't mean that this bug needs to be fixed immediately. But in fact it is an error that is documented here.
Disagree: while optional dependencies are indeed problematic, they are not bugs per-se, and rather require manual intervention.
Analyzing vendor/
code out of context is still a mistake, since you may even get random test assets in there, so be careful about your assumptions: this is NOT a bug.
They are a concept of the past: we got rid of them from new code, but there's no easy way around this.
The usage of such code with optional dependencies requires additional steps that are not "out of the box", and that is OK-ish, especially when compared with introducing BC breaks.
I will reopen it as an improvement to track for next major.