Skip to content

Commit

Permalink
db config check
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Apr 30, 2018
1 parent 891535d commit 90885fc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Middleware/ExpressiveFactory.php
Expand Up @@ -8,6 +8,7 @@
use ErrorHeroModule\Handler\Logging;
use ErrorHeroModule\Transformer\DoctrineToZendDb;
use Psr\Container\ContainerInterface;
use RuntimeException;
use Symfony\Component\DependencyInjection\ContainerBuilder as SymfonyContainerBuilder;
use Zend\Db\Adapter\Adapter;
use Zend\Log\Logger;
Expand All @@ -26,6 +27,10 @@ public function __invoke(ContainerInterface $container) : Expressive
}

if ($container instanceof SymfonyContainerBuilder) {
if (! isset($configuration['db'])) {
throw new \RuntimeException('db config is required for build Zend\Db\Adapter\Adapter instance');
}

$config = $configuration['db'];
$serviceManager = new ServiceManager();
if (isset($config['adapters'])) {
Expand Down

0 comments on commit 90885fc

Please sign in to comment.