Issue #1879444 by fabpot: Fixed Removed an unneeded factory.

8.0.x
webchick 2013-01-04 09:49:17 -08:00
parent 6314c62cbd
commit c5134bd676
2 changed files with 5 additions and 21 deletions

View File

@ -216,11 +216,13 @@ class CoreBundle extends Bundle {
->addTag('event_subscriber');
$container->register('config_global_override_subscriber', 'Drupal\Core\EventSubscriber\ConfigGlobalOverrideSubscriber')
->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')
->addTag('event_subscriber')
->addArgument(new Reference('service_container'))
->setFactoryClass('Drupal\Core\ExceptionController')
->setFactoryMethod('getExceptionListener');
->addArgument(array(new Reference('exception_controller'), 'execute'));
$container
->register('transliteration', 'Drupal\Core\Transliteration\PHPTransliteration');

View File

@ -27,24 +27,6 @@ class ExceptionController extends ContainerAware {
*/
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.
*