diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 89262fc752..8c510e283f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -4,18 +4,3 @@ parameters: message: "#^Call to an undefined method Drupal\\\\migrate\\\\Plugin\\\\MigrationInterface\\:\\:set\\(\\)\\.$#" count: 1 path: src/Commands/core/MigrateRunnerCommands.php - - - - message: "#^Call to an undefined method Drupal\\\\Core\\\\DependencyInjection\\\\ServiceModifierInterface\\:\\:check\\(\\)\\.$#" - count: 1 - path: src/Drupal/DrupalKernel.php - - - - message: "#^Call to an undefined method Drupal\\\\Core\\\\DependencyInjection\\\\ServiceModifierInterface\\:\\:check\\(\\)\\.$#" - count: 1 - path: src/Drupal/InstallerKernel.php - - - - message: "#^Call to an undefined method Drupal\\\\Core\\\\DependencyInjection\\\\ServiceModifierInterface\\:\\:check\\(\\)\\.$#" - count: 1 - path: src/Drupal/UpdateKernel.php diff --git a/src/Drupal/DrupalKernel.php b/src/Drupal/DrupalKernel.php index 4e13d5a54c..e2d9bcc0e2 100644 --- a/src/Drupal/DrupalKernel.php +++ b/src/Drupal/DrupalKernel.php @@ -11,5 +11,5 @@ */ class DrupalKernel extends DrupalDrupalKernel { - use DrupalKernelTrait; + // Nothing here anymore, but kept in case we need it later. } diff --git a/src/Drupal/DrupalKernelTrait.php b/src/Drupal/DrupalKernelTrait.php deleted file mode 100644 index ab96347fde..0000000000 --- a/src/Drupal/DrupalKernelTrait.php +++ /dev/null @@ -1,95 +0,0 @@ -boot(), so there is a chance - * for clients to add compiler passes et. al. before then. - */ - public function addServiceModifier(ServiceModifierInterface $serviceModifier) - { - Drush::logger()->debug((dt("Add service modifier"))); - $this->serviceModifiers[] = $serviceModifier; - } - - /** - * @inheritdoc - */ - protected function getContainerBuilder() - { - Drush::logger()->debug(dt("Get container builder")); - $container = parent::getContainerBuilder(); - foreach ($this->serviceModifiers as $serviceModifier) { - $serviceModifier->alter($container); - } - return $container; - } - - /** - * Initializes the service container. - * - * @return ContainerInterface - */ - protected function initializeContainer() - { - $container_definition = $this->getCachedContainerDefinition(); - - if ($this->shouldDrushInvalidateContainer()) { - // Normally when the container is being rebuilt, the existing - // container is still available for use until the newly built one - // replaces it. Certain contrib modules rely on services (like State - // or the config factory) being available for things like defining - // event subscriptions. - // @see https://github.com/drush-ops/drush/issues/3123 - if (isset($container_definition)) { - $class = Settings::get('container_base_class', '\Drupal\Core\DependencyInjection\Container'); - $container = new $class($container_definition); - $this->attachSynthetic($container); - \Drupal::setContainer($container); - } - - $this->invalidateContainer(); - } - return parent::initializeContainer(); - } - - protected function shouldDrushInvalidateContainer() - { - if (empty($this->moduleList) && !$this->containerNeedsRebuild) { - $container_definition = $this->getCachedContainerDefinition(); - foreach ($this->serviceModifiers as $serviceModifier) { - if (!$serviceModifier->check($container_definition)) { - return true; - } - } - } - return false; - } - - /** - * {@inheritdoc} - */ - public function discoverServiceProviders() - { - // Let Drupal discover all of its service providers - return parent::discoverServiceProviders(); - } -} diff --git a/src/Drupal/InstallerKernel.php b/src/Drupal/InstallerKernel.php index 8520637f94..646908da90 100644 --- a/src/Drupal/InstallerKernel.php +++ b/src/Drupal/InstallerKernel.php @@ -11,5 +11,5 @@ */ class InstallerKernel extends DrupalInstallerKernel { - use DrupalKernelTrait; + // Nothing here anymore, but kept in case we need it later. } diff --git a/src/Drupal/UpdateKernel.php b/src/Drupal/UpdateKernel.php index 961fa67060..5de8642cc6 100644 --- a/src/Drupal/UpdateKernel.php +++ b/src/Drupal/UpdateKernel.php @@ -11,5 +11,5 @@ */ class UpdateKernel extends DrupalUpdateKernel { - use DrupalKernelTrait; + // Nothing here anymore, but kept in case we need it later. }