Skip to content

Commit cf6fc53

Browse files
authored
Extension with optional latteFactory (#119)
1 parent a819298 commit cf6fc53

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/DI/TranslationExtension.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public function getConfigSchema(): Schema
8282
'translatorFactory' => Expect::string()->default(null),
8383
'returnOriginalMessage' => Expect::bool()->default(true),
8484
'autowired' => Expect::type('bool|array')->default(true),
85+
'latteFactory' => Expect::string(ILatteFactory::class)->nullable(),
8586
]);
8687
}
8788

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

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

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

0 commit comments

Comments
 (0)