You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The translator service in symfony 3.3 has changed arguments. Wrote this little patch that fixes it, but it didn't pass tests. Should probably applied and fixed before 3.3 is released.
diff --git a/src/DependencyInjection/EnumTranslationCompilerPass.php b/src/DependencyInjection/EnumTranslationCompil
index 5f4f79d..a1289d5 100644
--- a/src/DependencyInjection/EnumTranslationCompilerPass.php+++ b/src/DependencyInjection/EnumTranslationCompilerPass.php@@ -15,7 +15,21 @@ class EnumTranslationCompilerPass implements CompilerPassInterface
*/
public function process(ContainerBuilder $container)
{
- foreach ($container->getDefinition('translator.default')->getArgument(3)['resource_files'] as $files) {+ $resource_files = null;++ foreach ($container->getDefinition('translator.default')->getArguments() as $argument) {+ if (!isset($argument['resource_files'])) {+ continue;+ }++ $resource_files = (array) $argument['resource_files'];+ }++ if (null === $resource_files) {+ throw new \LogicException('Expected a translator argument to have an array with "resource_files".');+ }++ foreach ($resource_files as $files) {
$this->registerEnums($container, array_filter($files, function ($file) {
return preg_match('~/enum\.[a-z]+\.[a-z]+$~', $file) === 1;
}));
The text was updated successfully, but these errors were encountered:
The translator service in symfony 3.3 has changed arguments. Wrote this little patch that fixes it, but it didn't pass tests. Should probably applied and fixed before 3.3 is released.
The text was updated successfully, but these errors were encountered: