1414use Symfony \Component \DependencyInjection \ContainerBuilder ;
1515use Symfony \Component \DependencyInjection \Reference ;
1616use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
17+ use Symfony \Component \DependencyInjection \Exception \InvalidArgumentException ;
18+ use Symfony \Component \DependencyInjection \Exception \RuntimeException ;
1719
1820/**
1921 * Registers event listeners and subscribers to the available doctrine connections.
@@ -77,7 +79,7 @@ public function process(ContainerBuilder $container)
7779 uasort ($ subscribers , $ sortFunc );
7880 foreach ($ subscribers as $ id => $ instance ) {
7981 if ($ container ->getDefinition ($ id )->isAbstract ()) {
80- throw new \ InvalidArgumentException (sprintf ('The abstract service "%s" cannot be tagged as a doctrine event subscriber. ' , $ id ));
82+ throw new InvalidArgumentException (sprintf ('The abstract service "%s" cannot be tagged as a doctrine event subscriber. ' , $ id ));
8183 }
8284
8385 $ em ->addMethodCall ('addEventSubscriber ' , array (new Reference ($ id )));
@@ -93,7 +95,7 @@ public function process(ContainerBuilder $container)
9395 uasort ($ listeners , $ sortFunc );
9496 foreach ($ listeners as $ id => $ instance ) {
9597 if ($ container ->getDefinition ($ id )->isAbstract ()) {
96- throw new \ InvalidArgumentException (sprintf ('The abstract service "%s" cannot be tagged as a doctrine event listener. ' , $ id ));
98+ throw new InvalidArgumentException (sprintf ('The abstract service "%s" cannot be tagged as a doctrine event listener. ' , $ id ));
9799 }
98100
99101 $ em ->addMethodCall ('addEventListener ' , array (
@@ -116,7 +118,7 @@ private function groupByConnection(array $services, $isListener = false)
116118 foreach ($ instances as $ instance ) {
117119 if ($ isListener ) {
118120 if (!isset ($ instance ['event ' ])) {
119- throw new \ InvalidArgumentException (sprintf ('Doctrine event listener "%s" must specify the "event" attribute. ' , $ id ));
121+ throw new InvalidArgumentException (sprintf ('Doctrine event listener "%s" must specify the "event" attribute. ' , $ id ));
120122 }
121123 $ instance ['event ' ] = array ($ instance ['event ' ]);
122124
@@ -128,7 +130,7 @@ private function groupByConnection(array $services, $isListener = false)
128130 $ cons = isset ($ instance ['connection ' ]) ? array ($ instance ['connection ' ]) : $ allCons ;
129131 foreach ($ cons as $ con ) {
130132 if (!isset ($ grouped [$ con ])) {
131- throw new \ RuntimeException (sprintf ('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s ' , $ con , $ id , implode (', ' , array_keys ($ this ->connections ))));
133+ throw new RuntimeException (sprintf ('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s ' , $ con , $ id , implode (', ' , array_keys ($ this ->connections ))));
132134 }
133135
134136 if ($ isListener && isset ($ grouped [$ con ][$ id ])) {
0 commit comments