Skip to content

Commit de86596

Browse files
Merge branch '2.5' into 2.6
* 2.5: [Form] fixed a maxlength overring on a guessing [Debug] Show only unique class candidates [SecurityBundle] Firewall providers building - code cleaning [Filesystem] symlink use RealPath instead LinkTarget [DependencyInjection] Remove duplicate declaration in PhpDumper terminals are not interactive on Travis Revert "[DependencyInjection] backport perf optim" [WebProfilerBundle] replaced pattern to path attribute in routes definitions. fix phpdoc's alignment Fixed the AuthenticationProviderInterface alignment Fixed the proxy-manager version constraint [FrameworkBundle][Template name] avoid error message for the shortcut notation. [DependencyInjection] perf optim: call dirname() at most 5x [DependencyInjection] backport perf optim Fixed #12845 adding a listener to an event that is currently being dispatched will not result into a fatal error in TraceableEventDispatcher [EventDispatcher] [2.5] Remove possible call_user_func() [2.3] Remove possible call_user_func() Conflicts: src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php
2 parents 856d55e + fc0591c commit de86596

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

Tests/Debug/TraceableEventDispatcherTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,24 @@ public function testStopwatchStopControllerOnRequestEvent()
7575
$kernel->handle($request);
7676
}
7777

78+
public function testAddListenerNested()
79+
{
80+
$called1 = false;
81+
$called2 = false;
82+
$dispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch());
83+
$dispatcher->addListener('my-event', function () use ($dispatcher, &$called1, &$called2) {
84+
$called1 = true;
85+
$dispatcher->addListener('my-event', function () use (&$called2) {
86+
$called2 = true;
87+
});
88+
});
89+
$dispatcher->dispatch('my-event');
90+
$this->assertTrue($called1);
91+
$this->assertFalse($called2);
92+
$dispatcher->dispatch('my-event');
93+
$this->assertTrue($called2);
94+
}
95+
7896
protected function getHttpKernel($dispatcher, $controller)
7997
{
8098
$resolver = $this->getMock('Symfony\Component\HttpKernel\Controller\ControllerResolverInterface');

Tests/HttpCache/TestHttpKernel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public function callController(Request $request)
7272

7373
$response = new Response($this->body, $this->status, $this->headers);
7474

75-
if (null !== $this->customizer) {
76-
call_user_func($this->customizer, $request, $response);
75+
if (null !== $customizer = $this->customizer) {
76+
$customizer($request, $response);
7777
}
7878

7979
return $response;

0 commit comments

Comments
 (0)