| @@ 307-316 (lines=10) @@ | ||
| 304 | * |
|
| 305 | * @see EventDispatcherInterface::addSubscriber() |
|
| 306 | */ |
|
| 307 | public function addEventSubscriber(EventSubscriberInterface $subscriber) |
|
| 308 | { |
|
| 309 | if (!$this->dispatcher) { |
|
| 310 | $this->dispatcher = new EventDispatcher(); |
|
| 311 | } |
|
| 312 | ||
| 313 | $this->dispatcher->addSubscriber($subscriber); |
|
| 314 | ||
| 315 | return $this; |
|
| 316 | } |
|
| 317 | ||
| 318 | /** |
|
| 319 | * Removes an event listener for the given event name. |
|
| @@ 348-357 (lines=10) @@ | ||
| 345 | * |
|
| 346 | * @see EventDispatcherInterface::removeSubscriber() |
|
| 347 | */ |
|
| 348 | public function removeEventSubscriber(EventSubscriberInterface $subscriber) |
|
| 349 | { |
|
| 350 | if (!$this->dispatcher) { |
|
| 351 | $this->dispatcher = new EventDispatcher(); |
|
| 352 | } |
|
| 353 | ||
| 354 | $this->dispatcher->removeSubscriber($subscriber); |
|
| 355 | ||
| 356 | return $this; |
|
| 357 | } |
|
| 358 | ||
| 359 | /** |
|
| 360 | * Returns whether the application catches and displays exceptions thrown |
|