Skip to content

Commit 31e64bf

Browse files
Merge branch '3.3' into 3.4
* 3.3: [WebProfilerBundle] add missing tests Fix dump panel hidden when closing a dump FormInterface::getPropertyPath(): PropertyPathInterface|null [FrameworkBundle][Routing] Remove unused logger argument
2 parents 7398276 + 024bfa4 commit 31e64bf

File tree

10 files changed

+48
-16
lines changed

10 files changed

+48
-16
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
</service>
6060

6161
<service id="router.default" class="Symfony\Bundle\FrameworkBundle\Routing\Router">
62-
<tag name="monolog.logger" channel="router" />
6362
<argument type="service" id="service_container" />
6463
<argument>%router.resource%</argument>
6564
<argument type="collection">
@@ -75,7 +74,6 @@
7574
<argument key="matcher_cache_class">%router.options.matcher.cache_class%</argument>
7675
</argument>
7776
<argument type="service" id="router.request_context" on-invalid="ignore" />
78-
<argument type="service" id="logger" on-invalid="ignore" />
7977
<call method="setConfigCacheFactory">
8078
<argument type="service" id="config_cache_factory" />
8179
</call>

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@
9898
9999
Sfjs.toggleClass(this.parentNode, 'hover');
100100
});
101+
102+
var dumpInfo = document.querySelector('.sf-toolbar-block-dump .sf-toolbar-info');
103+
if (null !== dumpInfo) {
104+
Sfjs.addEventListener(dumpInfo, 'sfbeforedumpcollapse', function () {
105+
dumpInfo.style.minHeight = dumpInfo.getBoundingClientRect().height+'px';
106+
});
107+
Sfjs.addEventListener(dumpInfo, 'mouseleave', function () {
108+
dumpInfo.style.minHeight = '';
109+
});
110+
}
101111
},
102112
function(xhr) {
103113
if (xhr.status !== 0) {

src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,29 @@ public function testToolbarIsInjected()
8484
$this->assertEquals("<html><head></head><body>\nWDT\n</body></html>", $response->getContent());
8585
}
8686

87+
/**
88+
* @depends testToolbarIsInjected
89+
*/
90+
public function testToolbarIsNotInjectedOnNonHtmlContentType()
91+
{
92+
$response = new Response('<html><head></head><body></body></html>');
93+
$response->headers->set('X-Debug-Token', 'xxxxxxxx');
94+
$response->headers->set('Content-Type', 'text/xml');
95+
$event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, $response);
96+
97+
$listener = new WebDebugToolbarListener($this->getTwigMock());
98+
$listener->onKernelResponse($event);
99+
100+
$this->assertEquals('<html><head></head><body></body></html>', $response->getContent());
101+
}
102+
87103
/**
88104
* @depends testToolbarIsInjected
89105
*/
90106
public function testToolbarIsNotInjectedOnContentDispositionAttachment()
91107
{
92108
$response = new Response('<html><head></head><body></body></html>');
109+
$response->headers->set('X-Debug-Token', 'xxxxxxxx');
93110
$response->headers->set('Content-Disposition', 'attachment; filename=test.html');
94111
$event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(false, 'html'), HttpKernelInterface::MASTER_REQUEST, $response);
95112

src/Symfony/Component/Form/FormInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function getName();
171171
/**
172172
* Returns the property path that the form is mapped to.
173173
*
174-
* @return \Symfony\Component\PropertyAccess\PropertyPathInterface The property path
174+
* @return \Symfony\Component\PropertyAccess\PropertyPathInterface|null The property path
175175
*/
176176
public function getPropertyPath();
177177

src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Symfony\Component\Form\Extension\Core\Type\ChoiceType (choice_translation_domain
1616
Allowed values - %s
1717
---------------- --------------------%s
1818
Normalizer Closure { %s
19-
parameters: 2, %s
20-
file: "%s%eExtension%eCore%eType%eChoiceType.php",
19+
parameters: 2 %s
20+
file: "%s%eExtension%eCore%eType%eChoiceType.php"
2121
line: "%s to %s" %s
2222
} %s
2323
---------------- --------------------%s

src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (empty_data)
99
%s
1010
Closure(s): [ %s
1111
Closure { %s
12-
parameters: 1, %s
13-
file: "%s%eExtension%eCore%eType%eFormType.php",
12+
parameters: 1 %s
13+
file: "%s%eExtension%eCore%eType%eFormType.php"
1414
line: "%s to %s" %s
1515
}, %s
1616
Closure { %s
17-
parameters: 2, %s
18-
file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php",
17+
parameters: 2 %s
18+
file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php"
1919
line: "%s to %s" %s
2020
} %s
2121
] %s

src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (foo)
1717
] %s
1818
---------------- --------------------%s
1919
Normalizer Closure { %s
20-
parameters: 2, %s
21-
file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php",
20+
parameters: 2 %s
21+
file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php"
2222
line: "%s to %s" %s
2323
} %s
2424
---------------- --------------------%s

src/Symfony/Component/Form/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"symfony/http-kernel": "^3.3.5|~4.0",
3333
"symfony/security-csrf": "~2.8|~3.0|~4.0",
3434
"symfony/translation": "~2.8|~3.0|~4.0",
35-
"symfony/var-dumper": "~3.3|~4.0",
35+
"symfony/var-dumper": "^3.3.11|~4.0",
3636
"symfony/console": "~3.4|~4.0"
3737
},
3838
"conflict": {

src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ function toggle(a, recursive) {
165165
return false;
166166
}
167167
168+
if (doc.createEvent && s.dispatchEvent) {
169+
var event = doc.createEvent('Event');
170+
event.initEvent('sf-dump-expanded' === newClass ? 'sfbeforedumpexpand' : 'sfbeforedumpcollapse', true, false);
171+
172+
s.dispatchEvent(event);
173+
}
174+
168175
a.lastChild.innerHTML = arrow;
169176
s.className = s.className.replace(/\bsf-dump-(compact|expanded)\b/, newClass);
170177

src/Symfony/Component/VarDumper/Tests/Dumper/CliDumperTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ public function testDumpWithCommaFlagsAndExceptionCodeExcerpt()
147147
#file: "%ACliDumperTest.php"
148148
#line: %d
149149
trace: {
150-
%ACliDumperTest.php:%d: {
151-
:
152-
: $ex = new \RuntimeException('foo');
153-
:
150+
%ACliDumperTest.php:%d {
151+
152+
$ex = new \RuntimeException('foo');
153+
154154
}
155155
%A
156156
}

0 commit comments

Comments
 (0)