Skip to content

Commit

Permalink
Make config optional
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarlovi committed Jan 3, 2022
1 parent 981d33b commit d1331b9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/Bridge/Symfony/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ public function getConfigTreeBuilder()
->end()
->end()
->end()
->requiresAtLeastOneElement()
->isRequired()
->end()
->variableNode('database')
->end()
Expand Down
4 changes: 2 additions & 2 deletions src/Bridge/Symfony/DependencyInjection/KernelExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public function load(array $configs, ContainerBuilder $container)

$config = $this->processConfiguration($configuration, $configs);

$container->setParameter('sigwin_yassg.database', $config['database']);
$container->setParameter('sigwin_yassg.routes', $config['routes']);
$container->setParameter('sigwin_yassg.database', $config['database'] ?? []);
$container->setParameter('sigwin_yassg.routes', $config['routes'] ?? []);
}

public function getNamespace(): string
Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/Symfony/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private function configureContainer(ContainerConfigurator $container, LoaderInte
$container->import($configDir.'/{packages}/*.yaml');
$container->import($configDir.'/services.yaml');

$container->import($this->baseDir .'/config/*.yaml');
$container->import($this->baseDir .'/{config}/*.yaml');
}

public function build(ContainerBuilder $container): void
Expand Down

0 comments on commit d1331b9

Please sign in to comment.