Return empty array when configuration cannot be loaded

This commit is contained in:
Thibaud Fabre
2016-10-06 11:36:49 +02:00
parent d915c0d6e3
commit c48b490e18

View File

@@ -3,6 +3,7 @@
namespace Alchemy\Phrasea\Core\Provider;
use Alchemy\Phrasea\Core\Configuration\PropertyAccess;
use Alchemy\Phrasea\Exception\RuntimeException;
use Silex\Application;
use Silex\ServiceProviderInterface;
@@ -37,6 +38,7 @@ class WorkerConfigurationServiceProvider implements ServiceProviderInterface
]
];
try {
/** @var PropertyAccess $configuration */
$configuration = $app['conf'];
@@ -56,6 +58,10 @@ class WorkerConfigurationServiceProvider implements ServiceProviderInterface
$config = [ $queueConfiguration['name'] => $queueConfiguration ];
return $config;
}
catch (RuntimeException $exception) {
return [];
}
});
}
@@ -68,6 +74,6 @@ class WorkerConfigurationServiceProvider implements ServiceProviderInterface
*/
public function boot(Application $app)
{
// TODO: Implement boot() method.
// No-op
}
}