Skip to content
Snippets Groups Projects
Commit 4347a451 authored by catch's avatar catch
Browse files

Issue #1988508 by katbailey, aspilicious, dawehner: Stop pretending we support...

Issue #1988508 by katbailey, aspilicious, dawehner: Stop pretending we support Symfony bundles when we really just have service providers.
parent 818d4654
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
<?php
/**
* @file
* Contains \Drupal\Core\DependencyInjection\ServiceProviderBase.
*/
namespace Drupal\Core\DependencyInjection;
/**
* Base service provider implementation.
*/
abstract class ServiceProviderBase implements ServiceProviderInterface, ServiceModifierInterface {
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
}
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
}
}
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
use Drupal\Core\Config\BootstrapConfigStorageFactory; use Drupal\Core\Config\BootstrapConfigStorageFactory;
use Drupal\Core\CoreServiceProvider; use Drupal\Core\CoreServiceProvider;
use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;
use Drupal\Core\DependencyInjection\YamlFileLoader; use Drupal\Core\DependencyInjection\YamlFileLoader;
use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
...@@ -515,7 +516,9 @@ protected function buildContainer() { ...@@ -515,7 +516,9 @@ protected function buildContainer() {
$yaml_loader->load($filename); $yaml_loader->load($filename);
} }
foreach ($this->serviceProviders as $provider) { foreach ($this->serviceProviders as $provider) {
$provider->register($container); if ($provider instanceof ServiceProviderInterface) {
$provider->register($container);
}
} }
// Identify all services whose instances should be persisted when rebuilding // Identify all services whose instances should be persisted when rebuilding
......
...@@ -9,19 +9,11 @@ ...@@ -9,19 +9,11 @@
use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceModifierInterface; use Drupal\Core\DependencyInjection\ServiceModifierInterface;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;
/** /**
* Defines the LanguageTest service provider. * Defines the LanguageTest service provider.
*/ */
class LanguageTestServiceProvider implements ServiceProviderInterface, ServiceModifierInterface { class LanguageTestServiceProvider implements ServiceModifierInterface {
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
}
/** /**
* {@inheritdoc} * {@inheritdoc}
......
...@@ -8,17 +8,9 @@ ...@@ -8,17 +8,9 @@
namespace Drupal\service_provider_test; namespace Drupal\service_provider_test;
use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;
use Drupal\Core\DependencyInjection\ServiceModifierInterface; use Drupal\Core\DependencyInjection\ServiceModifierInterface;
class ServiceProviderTestServiceProvider implements ServiceProviderInterface, ServiceModifierInterface { class ServiceProviderTestServiceProvider implements ServiceModifierInterface {
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
}
/** /**
* {@inheritdoc} * {@inheritdoc}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment