This repository was archived by the owner on Jan 31, 2020. It is now read-only.
This repository was archived by the owner on Jan 31, 2020. It is now read-only.
injectTranslator is called to early #13
Open
Description
In Line 141 of /src/ValidatorPluginManager.php a new Initializer is added by the line:
$this->addInitializer([$this, 'injectTranslator']);
after parent::__construct() is called. Which means, that on creation of a new validator the method `injectTranslator()' is called before the closure:
$this->addInitializer(function ($instance) use ($self) {
if ($instance instanceof ServiceLocatorAwareInterface) {
$instance->setServiceLocator($self);
}
});
of the AbstractPluginManager is called.
But since the injectTranslator
method needs the serviceLocator and the serviceLocator isn't injected at this point of time, the result of $this->getServiceLocator()
in injectTranslator
will always be null. And that's why there will be never a translator injected.