Issue #1879444 by fabpot: Fixed Removed an unneeded factory.
parent
6314c62cbd
commit
c5134bd676
|
@ -216,11 +216,13 @@ class CoreBundle extends Bundle {
|
||||||
->addTag('event_subscriber');
|
->addTag('event_subscriber');
|
||||||
$container->register('config_global_override_subscriber', 'Drupal\Core\EventSubscriber\ConfigGlobalOverrideSubscriber')
|
$container->register('config_global_override_subscriber', 'Drupal\Core\EventSubscriber\ConfigGlobalOverrideSubscriber')
|
||||||
->addTag('event_subscriber');
|
->addTag('event_subscriber');
|
||||||
|
|
||||||
|
$container->register('exception_controller', 'Drupal\Core\ExceptionController')
|
||||||
|
->addArgument(new Reference('content_negotiation'))
|
||||||
|
->addMethodCall('setContainer', array(new Reference('service_container')));
|
||||||
$container->register('exception_listener', 'Drupal\Core\EventSubscriber\ExceptionListener')
|
$container->register('exception_listener', 'Drupal\Core\EventSubscriber\ExceptionListener')
|
||||||
->addTag('event_subscriber')
|
->addTag('event_subscriber')
|
||||||
->addArgument(new Reference('service_container'))
|
->addArgument(array(new Reference('exception_controller'), 'execute'));
|
||||||
->setFactoryClass('Drupal\Core\ExceptionController')
|
|
||||||
->setFactoryMethod('getExceptionListener');
|
|
||||||
|
|
||||||
$container
|
$container
|
||||||
->register('transliteration', 'Drupal\Core\Transliteration\PHPTransliteration');
|
->register('transliteration', 'Drupal\Core\Transliteration\PHPTransliteration');
|
||||||
|
|
|
@ -27,24 +27,6 @@ class ExceptionController extends ContainerAware {
|
||||||
*/
|
*/
|
||||||
protected $negotiation;
|
protected $negotiation;
|
||||||
|
|
||||||
/**
|
|
||||||
* Instantiates a new exception listener.
|
|
||||||
*
|
|
||||||
* Factory method for getting an Exception Listener. Since this needs to be
|
|
||||||
* instanciated with a controller callable, i.e. an ExceptionConroller object
|
|
||||||
* and the name of the method to call, we can't just register it to the DIC
|
|
||||||
* the regular way.
|
|
||||||
*
|
|
||||||
* @todo This probably doesn't belong here, but I'm not sure where would be a
|
|
||||||
* better place to put it... in a class of its own?
|
|
||||||
*/
|
|
||||||
public static function getExceptionListener(Container $container) {
|
|
||||||
$negotiation = $container->get('content_negotiation');
|
|
||||||
$exceptionController = new self($negotiation);
|
|
||||||
$exceptionController->setContainer($container);
|
|
||||||
return new ExceptionListener(array($exceptionController, 'execute'));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue