Skip to content

Commit

Permalink
Extension with optional latteFactory (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitkutny authored Jul 18, 2023
1 parent a819298 commit cf6fc53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DI/TranslationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public function getConfigSchema(): Schema
'translatorFactory' => Expect::string()->default(null),
'returnOriginalMessage' => Expect::bool()->default(true),
'autowired' => Expect::type('bool|array')->default(true),
'latteFactory' => Expect::string(ILatteFactory::class)->nullable(),
]);
}

Expand Down Expand Up @@ -229,7 +230,7 @@ public function beforeCompile(): void
$tracyPanel = $builder->getDefinition($this->prefix('tracyPanel'));
}

$latteFactoryName = $builder->getByType(ILatteFactory::class);
$latteFactoryName = $this->config->latteFactory ? $builder->getByType($this->config->latteFactory) : null;

if ($latteFactoryName !== null) {
$iTranslator = $builder->getDefinitionByType(ITranslator::class);
Expand Down

0 comments on commit cf6fc53

Please sign in to comment.