diff --git a/src/Bootstrap/DrupalKernelTrait.php b/src/Bootstrap/DrupalKernelTrait.php index 92a7d9962..c8a895a22 100644 --- a/src/Bootstrap/DrupalKernelTrait.php +++ b/src/Bootstrap/DrupalKernelTrait.php @@ -91,11 +91,14 @@ public function discoverDrupalConsoleServiceProviders() protected function addDrupalConsoleServices($root) { - $servicesFiles = [ - $root. DRUPAL_CONSOLE_CORE . 'services.yml', - $root. DRUPAL_CONSOLE . 'uninstall.services.yml', - $root. DRUPAL_CONSOLE . 'services.yml' - ]; + $servicesFiles = array_filter( + [ + $root. DRUPAL_CONSOLE_CORE . 'services.yml', + $root. DRUPAL_CONSOLE . 'uninstall.services.yml', + $root. DRUPAL_CONSOLE . 'services.yml' + ], + function ($file) { return file_exists($file); } + ); $this->addDrupalServiceFiles($servicesFiles); } @@ -122,10 +125,13 @@ protected function addDrupalConsoleConfigServices($root) protected function addDrupalConsoleExtendedServices($root) { - $servicesFiles = [ - $root . DRUPAL_CONSOLE . 'extend.console.services.yml', - $root . DRUPAL_CONSOLE . 'extend.console.uninstall.services.yml', - ]; + $servicesFiles = array_filter( + [ + $root . DRUPAL_CONSOLE . 'extend.console.services.yml', + $root . DRUPAL_CONSOLE . 'extend.console.uninstall.services.yml', + ], + function ($file) { return file_exists($file); } + ); $this->addDrupalServiceFiles($servicesFiles); }