8000 Merge branch '2.8' into 3.3 · symfony/symfony@024bfa4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 024bfa4

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

File tree

5 files changed

+35
-3
lines changed

5 files changed

+35
-3
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
@@ -93,6 +93,16 @@
9393
Sfjs.setPreference('toolbar/displayState', 'block');
9494
});
9595
Sfjs.renderAjaxRequests();
96+
97+
var dumpInfo = document.querySelector('.sf-toolbar-block-dump .sf-toolbar-info');
98+
if (null !== dumpInfo) {
99+
Sfjs.addEventListener(dumpInfo, 'sfbeforedumpcollapse', function () {
100+
dumpInfo.style.minHeight = dumpInfo.getBoundingClientRect().height+'px';
101+
});
102+
Sfjs.addEventListener(dumpInfo, 'mouseleave', function () {
103+
dumpInfo.style.minHeight = '';
104+
});
105+
}
96106
},
97107
function(xhr) {
98108
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/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

0 commit comments

Comments
 (0)
0