Skip to content

Commit 679c656

Browse files
committed
Revert "feature symfony#33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)"
This reverts commit 21a05de, reversing changes made to 24faadc.
1 parent c1ab2c6 commit 679c656

File tree

6 files changed

+16
-142
lines changed

6 files changed

+16
-142
lines changed

UPGRADE-4.4.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,6 @@ WebProfilerBundle
323323

324324
* Deprecated the `ExceptionController` class in favor of `ExceptionErrorController`
325325
* Deprecated the `TemplateManager::templateExists()` method
326-
* Deprecated the `web_profiler.intercept_redirects` config option,
327-
toolbar for the redirected resource contains a link to the redirect response profile instead.
328326

329327
WebServerBundle
330328
---------------

UPGRADE-5.0.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,6 @@ WebProfilerBundle
577577

578578
* Removed the `ExceptionController::templateExists()` method
579579
* Removed the `TemplateManager::templateExists()` method
580-
* Removed the `web_profiler.intercept_redirects` config option,
581-
toolbar for the redirected resource contains a link to the redirect response profile instead.
582580

583581
Workflow
584582
--------

src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ CHANGELOG
1212
* deprecated the `ExceptionController` in favor of `ExceptionPanelController`
1313
* marked all classes of the WebProfilerBundle as internal
1414
* added a section with the stamps of a message after it is dispatched in the Messenger panel
15-
* deprecated the `web_profiler.intercept_redirects` config option,
16-
toolbar for the redirected resource contains a link to the redirect response profile instead.
1715

1816
4.3.0
1917
-----

src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getConfigTreeBuilder()
3636
$treeBuilder->getRootNode()
3737
->children()
3838
->booleanNode('toolbar')->defaultFalse()->end()
39-
->booleanNode('intercept_redirects')->defaultFalse()->setDeprecated('The "intercept_redirects" option is deprecated since version 4.4 and will be removed in 5.0.')->end()
39+
->booleanNode('intercept_redirects')->defaultFalse()->end()
4040
->scalarNode('excluded_ajax_paths')->defaultValue('^/((index|app(_[\w]+)?)\.php/)?_wdt')->end()
4141
->end()
4242
;

src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 7 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -20,78 +20,23 @@ class ConfigurationTest extends TestCase
2020
/**
2121
* @dataProvider getDebugModes
2222
*/
23-
public function testConfigTree(array $options, array $expectedResult)
23+
public function testConfigTree($options, $results)
2424
{
2525
$processor = new Processor();
2626
$configuration = new Configuration();
2727
$config = $processor->processConfiguration($configuration, [$options]);
2828

29-
$this->assertEquals($expectedResult, $config);
29+
$this->assertEquals($results, $config);
3030
}
3131

3232
public function getDebugModes()
3333
{
3434
return [
35-
[
36-
'options' => [],
37-
'expectedResult' => [
38-
'intercept_redirects' => false,
39-
'toolbar' => false,
40-
'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt',
41-
],
42-
],
43-
[
44-
'options' => ['toolbar' => true],
45-
'expectedResult' => [
46-
'intercept_redirects' => false,
47-
'toolbar' => true,
48-
'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt',
49-
],
50-
],
51-
[
52-
'options' => ['excluded_ajax_paths' => 'test'],
53-
'expectedResult' => [
54-
'intercept_redirects' => false,
55-
'toolbar' => false,
56-
'excluded_ajax_paths' => 'test',
57-
],
58-
],
59-
];
60-
}
61-
62-
/**
63-
* @group legacy
64-
*
65-
* @dataProvider getInterceptRedirectsConfiguration
66-
*/
67-
public function testConfigTreeUsingInterceptRedirects(bool $interceptRedirects, array $expectedResult)
68-
{
69-
$processor = new Processor();
70-
$configuration = new Configuration();
71-
$config = $processor->processConfiguration($configuration, [['intercept_redirects' => $interceptRedirects]]);
72-
73-
$this->assertEquals($expectedResult, $config);
74-
}
75-
76-
public function getInterceptRedirectsConfiguration()
77-
{
78-
return [
79-
[
80-
'interceptRedirects' => true,
81-
'expectedResult' => [
82-
'intercept_redirects' => true,
83-
'toolbar' => false,
84-
'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt',
85-
],
86-
],
87-
[
88-
'interceptRedirects' => false,
89-
'expectedResult' => [
90-
'intercept_redirects' => false,
91-
'toolbar' => false,
92-
'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt',
93-
],
94-
],
35+
[[], ['intercept_redirects' => false, 'toolbar' => false, 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt']],
36+
[['intercept_redirects' => true], ['intercept_redirects' => true, 'toolbar' => false, 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt']],
37+
[['intercept_redirects' => false], ['intercept_redirects' => false, 'toolbar' => false, 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt']],
38+
[['toolbar' => true], ['intercept_redirects' => false, 'toolbar' => true, 'excluded_ajax_paths' => '^/((index|app(_[\w]+)?)\.php/)?_wdt']],
39+
[['excluded_ajax_paths' => 'test'], ['intercept_redirects' => false, 'toolbar' => false, 'excluded_ajax_paths' => 'test']],
9540
];
9641
}
9742
}

src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php

Lines changed: 8 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,13 @@ public function testDefaultConfig($debug)
9999
self::assertSaneContainer($this->getCompiledContainer());
100100
}
101101

102-
public function getDebugModes()
103-
{
104-
return [
105-
['debug' => false],
106-
['debug' => true],
107-
];
108-
}
109-
110102
/**
111-
* @dataProvider getToolbarConfig
103+
* @dataProvider getDebugModes
112104
*/
113-
public function testToolbarConfig(bool $toolbarEnabled, bool $listenerInjected, bool $listenerEnabled)
105+
public function testToolbarConfig($toolbarEnabled, $interceptRedirects, $listenerInjected, $listenerEnabled)
114106
{
115107
$extension = new WebProfilerExtension();
116-
$extension->load([['toolbar' => $toolbarEnabled]], $this->container);
108+
$extension->load([['toolbar' => $toolbarEnabled, 'intercept_redirects' => $interceptRedirects]], $this->container);
117109
$this->container->removeDefinition('web_profiler.controller.exception');
118110

119111
$this->assertSame($listenerInjected, $this->container->has('web_profiler.debug_toolbar'));
@@ -125,70 +117,13 @@ public function testToolbarConfig(bool $toolbarEnabled, bool $listenerInjected,
125117
}
126118
}
127119

128-
public function getToolbarConfig()
129-
{
130-
return [
131-
[
132-
'toolbarEnabled' => false,
133-
'listenerInjected' => false,
134-
'listenerEnabled' => false,
135-
],
136-
[
137-
'toolbarEnabled' => true,
138-
'listenerInjected' => true,
139-
'listenerEnabled' => true,
140-
],
141-
];
142-
}
143-
144-
/**
145-
* @group legacy
146-
*
147-
* @dataProvider getInterceptRedirectsToolbarConfig
148-
*/
149-
public function testToolbarConfigUsingInterceptRedirects(
150-
bool $toolbarEnabled,
151-
bool $interceptRedirects,
152-
bool $listenerInjected,
153-
bool $listenerEnabled
154-
) {
155-
$extension = new WebProfilerExtension();
156-
$extension->load(
157-
[['toolbar' => $toolbarEnabled, 'intercept_redirects' => $interceptRedirects]],
158-
$this->container
159-
);
160-
$this->container->removeDefinition('web_profiler.controller.exception');
161-
162-
$this->assertSame($listenerInjected, $this->container->has('web_profiler.debug_toolbar'));
163-
164-
self::assertSaneContainer($this->getCompiledContainer(), '', ['web_profiler.csp.handler']);
165-
166-
if ($listenerInjected) {
167-
$this->assertSame($listenerEnabled, $this->container->get('web_profiler.debug_toolbar')->isEnabled());
168-
}
169-
}
170-
171-
public function getInterceptRedirectsToolbarConfig()
120+
public function getDebugModes()
172121
{
173122
return [
174-
[
175-
'toolbarEnabled' => false,
176-
'interceptRedirects' => true,
177-
'listenerInjected' => true,
178-
'listenerEnabled' => false,
179-
],
180-
[
181-
'toolbarEnabled' => false,
182-
'interceptRedirects' => false,
183-
'listenerInjected' => false,
184-
'listenerEnabled' => false,
185-
],
186-
[
187-
'toolbarEnabled' => true,
188-
'interceptRedirects' => true,
189-
'listenerInjected' => true,
190-
'listenerEnabled' => true,
191-
],
123+
[false, false, false, false],
124+
[true, false, true, true],
125+
[false, true, true, false],
126+
[true, true, true, true],
192127
];
193128
}
194129

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy