File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class WrappedListener
29
29
private $ stopwatch ;
30
30
private $ dispatcher ;
31
31
private $ pretty ;
32
- private $ data ;
32
+ private $ stub ;
33
33
34
34
private static $ cloner ;
35
35
@@ -91,15 +91,15 @@ public function getPretty()
91
91
92
92
public function getInfo ($ eventName )
93
93
{
94
- if (null === $ this ->data ) {
95
- $ this ->data = false !== self ::$ cloner ? self :: $ cloner -> cloneVar ( array ( new ClassStub ($ this ->pretty .'() ' , $ this ->listener )))-> seek ( 0 ) : $ this -> pretty ;
94
+ if (null === $ this ->stub ) {
95
+ $ this ->stub = false === self ::$ cloner ? $ this -> pretty . ' () ' : new ClassStub ($ this ->pretty .'() ' , $ this ->listener );
96
96
}
97
97
98
98
return array (
99
99
'event ' => $ eventName ,
100
100
'priority ' => null !== $ this ->dispatcher ? $ this ->dispatcher ->getListenerPriority ($ eventName , $ this ->listener ) : null ,
101
101
'pretty ' => $ this ->pretty ,
102
- 'data ' => $ this ->data ,
102
+ 'stub ' => $ this ->stub ,
103
103
);
104
104
}
105
105
Original file line number Diff line number Diff line change @@ -97,16 +97,16 @@ public function testGetCalledListeners()
97
97
$ tdispatcher ->addListener ('foo ' , $ listener = function () {});
98
98
99
99
$ listeners = $ tdispatcher ->getNotCalledListeners ();
100
- $ this ->assertArrayHasKey ('data ' , $ listeners ['foo.closure ' ]);
101
- unset($ listeners ['foo.closure ' ]['data ' ]);
100
+ $ this ->assertArrayHasKey ('stub ' , $ listeners ['foo.closure ' ]);
101
+ unset($ listeners ['foo.closure ' ]['stub ' ]);
102
102
$ this ->assertEquals (array (), $ tdispatcher ->getCalledListeners ());
103
103
$ this ->assertEquals (array ('foo.closure ' => array ('event ' => 'foo ' , 'pretty ' => 'closure ' , 'priority ' => 0 )), $ listeners );
104
104
105
105
$ tdispatcher ->dispatch ('foo ' );
106
106
107
107
$ listeners = $ tdispatcher ->getCalledListeners ();
108
- $ this ->assertArrayHasKey ('data ' , $ listeners ['foo.closure ' ]);
109
- unset($ listeners ['foo.closure ' ]['data ' ]);
108
+ $ this ->assertArrayHasKey ('stub ' , $ listeners ['foo.closure ' ]);
109
+ unset($ listeners ['foo.closure ' ]['stub ' ]);
110
110
$ this ->assertEquals (array ('foo.closure ' => array ('event ' => 'foo ' , 'pretty ' => 'closure ' , 'priority ' => null )), $ listeners );
111
111
$ this ->assertEquals (array (), $ tdispatcher ->getNotCalledListeners ());
112
112
}
You can’t perform that action at this time.
0 commit comments