Skip to content

Commit 12f6db8

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

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
@@ -51,7 +51,6 @@
5151
</service>
5252

5353
<service id="router.default" class="Symfony\Bundle\FrameworkBundle\Routing\Router">
54-
<tag name="monolog.logger" channel="router" />
5554
<argument type="service" id="service_container" />
5655
<argument>%router.resource%</argument>
5756
<argument type="collection">
@@ -67,7 +66,6 @@
6766
<argument key="matcher_cache_class">%router.cache_class_prefix%UrlMatcher</argument>
6867
</argument>
6968
<argument type="service" id="router.request_context" on-invalid="ignore" />
70-
<argument type="service" id="logger" on-invalid="ignore" />
7169
<call method="setConfigCacheFactory">
7270
<argument type="service" id="config_cache_factory" />
7371
</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
@@ -90,6 +90,16 @@
9090
9191
Sfjs.toggleClass(this.parentNode, 'hover');
9292
});
93+
94+
var dumpInfo = document.querySelector('.sf-toolbar-block-dump .sf-toolbar-info');
95+
if (null !== dumpInfo) {
96+
Sfjs.addEventListener(dumpInfo, 'sfbeforedumpcollapse', function () {
97+
dumpInfo.style.minHeight = dumpInfo.getBoundingClientRect().height+'px';
98+
});
99+
Sfjs.addEventListener(dumpInfo, 'mouseleave', function () {
100+
dumpInfo.style.minHeight = '';
101+
});
102+
}
93103
},
94104
function(xhr) {
95105
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
@@ -33,7 +33,7 @@
3333
"symfony/http-kernel": "~3.4|~4.0",
3434
"symfony/security-csrf": "~3.4|~4.0",
3535
"symfony/translation": "~3.4|~4.0",
36-
"symfony/var-dumper": "~3.4|~4.0"
36+
"symfony/var-dumper": "~3.4-beta3|~4.0"
3737
},
3838
"conflict": {
3939
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",

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
@@ -146,10 +146,10 @@ public function testDumpWithCommaFlagsAndExceptionCodeExcerpt()
146146
#file: "%ACliDumperTest.php"
147147
#line: %d
148148
trace: {
149-
%ACliDumperTest.php:%d: {
150-
:
151-
: $ex = new \RuntimeException('foo');
152-
:
149+
%ACliDumperTest.php:%d {
150+
151+
$ex = new \RuntimeException('foo');
152+
153153
}
154154
%A
155155
}

0 commit comments

Comments
 (0)