Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • ContainerAwareEventDispatcher
  • Event
  • EventDispatcher
  • GenericEvent
  • ImmutableEventDispatcher

Interfaces

  • EventDispatcherInterface
  • EventSubscriberInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 1: <?php
 2: 
 3: /*
 4:  * This file is part of the Symfony package.
 5:  *
 6:  * (c) Fabien Potencier <fabien@symfony.com>
 7:  *
 8:  * For the full copyright and license information, please view the LICENSE
 9:  * file that was distributed with this source code.
10:  */
11: 
12: namespace Symfony\Component\EventDispatcher;
13: 
14: /**
15:  * A read-only proxy for an event dispatcher.
16:  *
17:  * @author Bernhard Schussek <bschussek@gmail.com>
18:  */
19: class ImmutableEventDispatcher implements EventDispatcherInterface
20: {
21:     /**
22:      * The proxied dispatcher.
23:      * @var EventDispatcherInterface
24:      */
25:     private $dispatcher;
26: 
27:     /**
28:      * Creates an unmodifiable proxy for an event dispatcher.
29:      *
30:      * @param EventDispatcherInterface $dispatcher The proxied event dispatcher.
31:      */
32:     public function __construct(EventDispatcherInterface $dispatcher)
33:     {
34:         $this->dispatcher = $dispatcher;
35:     }
36: 
37:     /**
38:      * {@inheritdoc}
39:      */
40:     public function dispatch($eventName, Event $event = null)
41:     {
42:         return $this->dispatcher->dispatch($eventName, $event);
43:     }
44: 
45:     /**
46:      * {@inheritdoc}
47:      */
48:     public function addListener($eventName, $listener, $priority = 0)
49:     {
50:         throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
51:     }
52: 
53:     /**
54:      * {@inheritdoc}
55:      */
56:     public function addSubscriber(EventSubscriberInterface $subscriber)
57:     {
58:         throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
59:     }
60: 
61:     /**
62:      * {@inheritdoc}
63:      */
64:     public function removeListener($eventName, $listener)
65:     {
66:         throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
67:     }
68: 
69:     /**
70:      * {@inheritdoc}
71:      */
72:     public function removeSubscriber(EventSubscriberInterface $subscriber)
73:     {
74:         throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
75:     }
76: 
77:     /**
78:      * {@inheritdoc}
79:      */
80:     public function getListeners($eventName = null)
81:     {
82:         return $this->dispatcher->getListeners($eventName);
83:     }
84: 
85:     /**
86:      * {@inheritdoc}
87:      */
88:     public function hasListeners($eventName = null)
89:     {
90:         return $this->dispatcher->hasListeners($eventName);
91:     }
92: }
93: 
php-coveralls API documentation generated by ApiGen 2.8.0