Skip to content

Commit

Permalink
Update src/DependencyInjection/NeustaConverterExtension.php
Browse files Browse the repository at this point in the history
I like that much more...

Co-authored-by: Jacob Dreesen <j.dreesen@neusta.de>
  • Loading branch information
2 people authored and Niclas Witte committed Apr 18, 2024
1 parent 66132bf commit 9ac6c99
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/DependencyInjection/NeustaConverterExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ public function loadInternal(array $mergedConfig, ContainerBuilder $container):
*/
private function registerConverterConfiguration(string $id, array $config, ContainerBuilder $container): void
{
if (!$targetFactoryId = $config['target_factory'] ?? null) {
$container->register($targetFactoryId = "{$id}.target_factory", GenericTargetFactory::class)
$targetFactoryId = $config['target_factory'] ?? "{$id}.target_factory";

if (!isset($config['target_factory'])) {
$container->register($targetFactoryId, GenericTargetFactory::class)
->setArguments([
'$type' => new Reference($config['target']),
]);
Expand Down

0 comments on commit 9ac6c99

Please sign in to comment.