-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Translator factory has hidden dependency on laminas/laminas-cache-storage-deprecated-factory #134
Comments
The problem is the soft dependency on laminas-cache. If laminas-cache is not needed then the deprecated factory is also not needed. |
In the meantime is it worth adding a warning to Translator? Something like
|
Ideally, the soft dependencies should be made hard dependencies - symbols are used in WDYT @froschdesign? |
The documentation must also be modified for this, because if a user follows a description in the documentation, no error message should be triggered. Related to: https://docs.laminas.dev/laminas-i18n/translator/factory/#using-cache-configuration But this also means that a currently running laminas mvc-based application that uses the configuration for the translator triggers this error. This creates extra work on the user side (e.g. creating a delegator) or at least anger and frustration. |
So, perhaps documentation first, followed by a patch to introduce the deprecation. That way, the deprecation message can link to the updated documentation with a full explanation. |
Also, I assume that this comment means that translators should be decorated with extra functionality, i.e. |
Right, this would open the door to add more features and also on the user side. The translator itself is reduced to a message loader and a message formatter (both can be plugin managers). Everything else can be decorators. |
Bug Report
Summary
We cleaned up our composer dependencies and removed the
laminas/laminas-cache-storage-deprecated-factory
because there weren't any usages in our code.After that, the factory of the Translator exploded because it tries to instantiate the cache for the translator with the
StorageFactory
from said package.Current behavior
The application explodes because
\Laminas\Cache\StorageFactory
cannot be found.How to reproduce
Add
to the config and try to pull
\Laminas\I18n\Translator\Translator
from the container or build it withTranslator::factory($options)
where$options
is the above array inside thetranslator
key.Expected behavior
No boom 🙂
I think either the dependency should be added to the
require
section and notrequire-dev
or the factory should use the newStorageAdapterFactoryInterface
(?) instead of the deprecated one.The text was updated successfully, but these errors were encountered: