Permalink
Browse files

$config[paths] throws exception is if not an array

  • Loading branch information...
1 parent 1c92cb5 commit ec84d2c4631bf9995ffa1293c78ed11ebf9567a9 @Mparaiso committed Apr 2, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/Mparaiso/Provider/DoctrineORMServiceProvider.php
View
2 src/Mparaiso/Provider/DoctrineORMServiceProvider.php
@@ -3,6 +3,7 @@
namespace Mparaiso\Provider;
use Silex\ServiceProviderInterface;
+use Exception;
use Mparaiso\Doctrine\ORM\DoctrineManagerRegistry;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
@@ -76,6 +77,7 @@ public function register(Application $app)
*/
$app["orm.em"] = $app->share(function ($app) use ($self) {
foreach ($app["orm.driver.configs"] as $key => $config) {
+ if(! is_array($config['paths'])throw new Exception(' $config["paths"] must be an array of paths ');
if ($key == "default") {
$app["orm.chain_driver"]->setDefaultDriver($self->getDriver($config['type'], $config['paths'], $app["orm.config"]));
}

0 comments on commit ec84d2c

Please sign in to comment.