Skip to content

Commit

Permalink
group related if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanotorresi committed Feb 9, 2017
1 parent 1c2aad7 commit 175e8d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/DriverFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ protected function createWithConfig(ContainerInterface $container, $configKey)
&& (FileDriver::class === $config['class'] || is_subclass_of($config['class'], FileDriver::class))
) {
$driver = new $config['class']($config['paths'], $config['extension']);

if (isset($config['global_basename'])) {
$driver->setGlobalBasename($config['global_basename']);
}
}

if (! isset($driver)) {
$driver = new $config['class']($config['paths']);
}

if (isset($config['global_basename']) && $driver instanceof FileDriver) {
$driver->setGlobalBasename($config['global_basename']);
}

if ($driver instanceof MappingDriverChain) {
foreach ($config['drivers'] as $namespace => $driverName) {
if (null === $driverName) {
Expand Down

0 comments on commit 175e8d5

Please sign in to comment.