Commit 4347a451 authored by catch's avatar catch

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
<?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 @@
use Drupal\Core\Config\BootstrapConfigStorageFactory;
use Drupal\Core\CoreServiceProvider;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;
use Drupal\Core\DependencyInjection\YamlFileLoader;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
......@@ -515,7 +516,9 @@ protected function buildContainer() {
$yaml_loader->load($filename);
}
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
......
......@@ -9,19 +9,11 @@
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceModifierInterface;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;
/**
* Defines the LanguageTest service provider.
*/
class LanguageTestServiceProvider implements ServiceProviderInterface, ServiceModifierInterface {
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
}
class LanguageTestServiceProvider implements ServiceModifierInterface {
/**
* {@inheritdoc}
......
......@@ -8,17 +8,9 @@
namespace Drupal\service_provider_test;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;
use Drupal\Core\DependencyInjection\ServiceModifierInterface;
class ServiceProviderTestServiceProvider implements ServiceProviderInterface, ServiceModifierInterface {
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
}
class ServiceProviderTestServiceProvider implements ServiceModifierInterface {
/**
* {@inheritdoc}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment