Lines Matching refs:dispatcher

24     protected $dispatcher;  variable in JMS\\Serializer\\Tests\\Serializer\\EventDispatcher\\EventDispatcherTest
30 self::assertFalse($this->dispatcher->hasListeners('foo', 'Foo', 'json'));
31 $this->dispatcher->addListener('foo', static function () {
33 self::assertTrue($this->dispatcher->hasListeners('foo', 'Foo', 'json'));
35 self::assertFalse($this->dispatcher->hasListeners('bar', 'Bar', 'json'));
36 $this->dispatcher->addListener('bar', static function () {
38 self::assertFalse($this->dispatcher->hasListeners('bar', 'Bar', 'json'));
39 $this->dispatcher->addListener('bar', static function () {
41 self::assertFalse($this->dispatcher->hasListeners('bar', 'Bar', 'json'));
42 $this->dispatcher->addListener('bar', static function () {
44 self::assertTrue($this->dispatcher->hasListeners('bar', 'Baz', 'json'));
45 self::assertTrue($this->dispatcher->hasListeners('bar', 'Bar', 'json'));
47 self::assertFalse($this->dispatcher->hasListeners('baz', 'Bar', 'xml'));
48 $this->dispatcher->addListener('baz', static function () {
50 self::assertTrue($this->dispatcher->hasListeners('baz', 'Bar', 'xml'));
57 $this->dispatcher->addListener('foo', [$a, 'Foo']);
62 $this->dispatcher->addListener('pre', [$b, 'bar'], 'Bar');
63 $this->dispatcher->addListener('pre', [$b, 'foo'], 'Foo');
64 $this->dispatcher->addListener('pre', [$b, 'all']);
66 $b->bar($this->event, 'pre', 'Bar', 'json', $this->dispatcher);
67 $b->all($this->event, 'pre', 'Bar', 'json', $this->dispatcher);
68 $b->foo($this->event, 'pre', 'Foo', 'json', $this->dispatcher);
69 $b->all($this->event, 'pre', 'Foo', 'json', $this->dispatcher);
81 $this->dispatcher->addListener('pre', [$a, 'onlyProxy'], 'Bar', 'json', Proxy::class);
82 $this->dispatcher->addListener('pre', [$a, 'all'], 'Bar', 'json');
88 $a->onlyProxy($event, 'pre', 'Bar', 'json', $this->dispatcher);
89 $a->all($event, 'pre', 'Bar', 'json', $this->dispatcher);
100 $this->dispatcher->addListener('pre', [$a, 'onlyProxy'], 'Bar', 'json', Proxy::class);
101 $this->dispatcher->addListener('pre', [$a, 'all'], 'Bar', 'json');
107 $a->all($event, 'pre', 'Bar', 'json', $this->dispatcher);
119 $this->dispatcher->addListener('pre', static function (Event $event) use (&$listener1) {
124 $this->dispatcher->addListener('pre', static function () use (&$listener2) {
140 …$this->dispatcher->addListener('pre', static function (Event $event, $eventName, $loweredClass, $f…
149 $dispatcher->dispatch('post', 'Blah', 'xml', $event);
152 $this->dispatcher->addListener('pre', static function () use (&$listener2) {
156 …$this->dispatcher->addListener('post', static function (Event $event, $eventName, $loweredClass, $…
179 $this->dispatcher->addSubscriber($subscriber);
187 ], 'listeners', $this->dispatcher);
194 $this->dispatcher = $this->createEventDispatcher();
205 $this->dispatcher->dispatch($eventName, $class, $format, $event ?: $this->event);