8000 Drop usage of TraceableEventDispatcherInterface in favor of concrete … · symfony/symfony@e637fb3 · GitHub
[go: up one dir, main page]

Skip to content

Commit e637fb3

Browse files
committed
Drop usage of TraceableEventDispatcherInterface in favor of concrete implementation
1 parent 6fa817b commit e637fb3

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

src/Symfony/Component/HttpKernel/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ CHANGELOG
99
4.0.0
1010
-----
1111

12-
* added orphaned events support to `EventDataCollector`
1312
* removed the `DataCollector::varToString()` method, use `DataCollector::cloneVar()`
1413
instead
1514
* using the `DataCollector::cloneVar()` method requires the VarDumper component
@@ -34,6 +33,7 @@ CHANGELOG
3433
3.4.0
3534
-----
3635

36+
* added orphaned events support to `EventDataCollector`
3737
* added a minimalist PSR-3 `Logger` class that writes in `stderr`
3838
* made kernels implementing `CompilerPassInterface` able to process the container
3939
* deprecated bundle inheritance

src/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
namespace Symfony\Component\HttpKernel\DataCollector;
1313

14+
use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher;
15+
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
1416
use Symfony\Component\HttpFoundation\Request;
1517
use Symfony\Component\HttpFoundation\Response;
16-
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
17-
use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface;
1818

1919
/**
2020
* EventDataCollector.
@@ -53,7 +53,7 @@ public function reset()
5353

5454
public function lateCollect()
5555
{
56-
if ($this->dispatcher instanceof TraceableEventDispatcherInterface) {
56+
if ($this->dispatcher instanceof TraceableEventDispatcher) {
5757
$this->setCalledListeners($this->dispatcher->getCalledListeners());
5858
$this->setNotCalledListeners($this->dispatcher->getNotCalledListeners());
5959
$this->setOrphanedEvents($this->dispatcher->getOrphanedEvents());
@@ -66,67 +66,67 @@ public function lateCollect()
6666
*
6767
* @param array $listeners An array of called listeners
6868
*
69-
* @see TraceableEventDispatcherInterface
69+
* @see TraceableEventDispatcher
7070
*/
7171
public function setCalledListeners(array $listeners)
7272
{
7373
$this->data['called_listeners'] = $listeners;
7474
}
7575

7676
/**
77-
* Gets the called listeners.
77+
* Sets the not called listeners.
7878
*
79-
* @return array An array of called listeners
79+
* @param array $listeners An array of not called listeners
8080
*
81-
* @see TraceableEventDispatcherInterface
81+
* @see TraceableEventDispatcher
8282
*/
83-
public function getCalledListeners()
83+
public function setNotCalledListeners(array $listeners)
8484
{
85-
return $this->data['called_listeners'];
85+
$this->data['not_called_listeners'] = $listeners;
8686
}
8787

8888
/**
89-
* Sets the not called listeners.
89+
* Sets the orphaned events.
9090
*
91-
* @param array $listeners An array of not called listeners
91+
* @param array $events An array of orphaned events
9292
*
93-
* @see TraceableEventDispatcherInterface
93+
* @see TraceableEventDispatcher
9494
*/
95-
public function setNotCalledListeners(array $listeners)
95+
public function setOrphanedEvents(array $events)
9696
{
97-
$this->data['not_called_listeners'] = $listeners;
97+
$this->data['orphaned_events'] = $events;
9898
}
9999

100100
/**
101-
* Gets the not called listeners.
101+
* Gets the called listeners.
102102
*
103-
* @return array An array of not called listeners
103+
* @return array An array of called listeners
104104
*
105-
* @see TraceableEventDispatcherInterface
105+
* @see TraceableEventDispatcher
106106
*/
107-
public function getNotCalledListeners()
107+
public function getCalledListeners()
108108
{
109-
return $this->data['not_called_listeners'];
109+
return $this->data['called_listeners'];
110110
}
111111

112112
/**
113-
* Sets the orphaned events.
113+
* Gets the not called listeners.
114114
*
115-
* @param array $events An array of orphaned events
115+
* @return array An array of not called listeners
116116
*
117-
* @see TraceableEventDispatcherInterface
117+
* @see TraceableEventDispatcher
118118
*/
119-
public function setOrphanedEvents(array $events)
119+
public function getNotCalledListeners()
120120
{
121-
$this->data['orphaned_events'] = $events;
121+
return $this->data['not_called_listeners'];
122122
}
123123

124124
/**
125125
* Gets the orphaned events.
126126
*
127127
* @return array An array of orphaned events
128128
*
129-
* @see TraceableEventDispatcherInterface
129+
* @see TraceableEventDispatcher
130130
*/
131131
public function getOrphanedEvents()
132132
{

0 commit comments

Comments
 (0)
0