Skip to content

Commit 9255b06

Browse files
committed
Merge branch '2.3' into 2.4
* 2.3: (31 commits) Fix parent serialization of user object [DependencyInjection] fixed typo add memcache, memcached, and mongodb extensions to run skipped tests [DependencyInjection] Fixed support for backslashes in service ids. fix #9356 [Security] Logger should manipulate the user reloaded from provider [BrowserKit] fixes #8311 CookieJar is totally ignorant of RFC 6265 edge cases [HttpFoundation] fixed constants that do exist in 2.3 (only in 2.4) fix 5528 let ArrayNode::normalizeValue respect order of value array provided fix #7243 allow 0 as arraynode name Fixed issue in BaseDateTimeTransformer when invalid timezone cause Transformation filed exception (closes #9403). BinaryFileResponse should also return 416 or 200 on some range-requets Do normalization on tag options bumped Symfony version to 2.3.9 updated VERSION for 2.3.8 update CONTRIBUTORS for 2.3.8 updated CHANGELOG for 2.3.8 [Filesystem] Changed the mode for a target file in copy() to be write only. [Console] fixed CS fixed TableHelper when cell value has new line Improved and fixed grammar mistakes. Added pluralized messages ... Conflicts: src/Symfony/Component/BrowserKit/Cookie.php src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/Routing/Matcher/UrlMatcher.php
2 parents 59472b6 + be35a70 commit 9255b06

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

Debug/TraceableEventDispatcher.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, TraceableEve
3636
private $wrappedListeners = array();
3737
private $firstCalledEvent = array();
3838
private $id;
39+
private $lastEventId = 0;
3940

4041
/**
4142
* Constructor.
@@ -123,7 +124,7 @@ public function dispatch($eventName, Event $event = null)
123124
$event = new Event();
124125
}
125126

126-
$this->id = spl_object_hash($event);
127+
$this->id = $eventId = ++$this->lastEventId;
127128

128129
$this->preDispatch($eventName, $event);
129130

@@ -138,7 +139,7 @@ public function dispatch($eventName, Event $event = null)
138139
$this->dispatcher->dispatch($eventName, $event);
139140

140141
// reset the id as another event might have been dispatched during the dispatching of this event
141-
$this->id = spl_object_hash($event);
142+
$this->id = $eventId;
142143

143144
unset($this->firstCalledEvent[$eventName]);
144145

Tests/Debug/TraceableEventDispatcherTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,22 @@ public function testDispatchNested()
148148
$dispatcher->dispatch('foo');
149149
}
150150

151+
public function testDispatchReusedEventNested()
152+
{
153+
$nestedCall = false;
154+
$dispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch());
155+
$dispatcher->addListener('foo', function (Event $e) use ($dispatcher) {
156+
$dispatcher->dispatch('bar', $e);
157+
});
158+
$dispatcher->addListener('bar', function (Event $e) use (&$nestedCall) {
159+
$nestedCall = true;
160+
});
161+
162+
$this->assertFalse($nestedCall);
163+
$dispatcher->dispatch('foo');
164+
$this->assertTrue($nestedCall);
165+
}
166+
151167
public function testStopwatchSections()
152168
{
153169
$dispatcher = new TraceableEventDispatcher(new EventDispatcher(), $stopwatch = new Stopwatch());

0 commit comments

Comments
 (0)