Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 41de91c

Browse files
Merge branch '3.4'
* 3.4: Fixed deprecations in WebProfiler tests Fix BC break in console.command.ids parameter
2 parents 5d56791 + a5130b2 commit 41de91c

File tree

8 files changed

+24
-13
lines changed

8 files changed

+24
-13
lines changed

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ CHANGELOG
7373
`EventDispatcherDebugCommand`, `RouterDebugCommand`, `RouterMatchCommand`,
7474
`TranslationDebugCommand`, `TranslationUpdateCommand`, `XliffLintCommand`
7575
and `YamlLintCommand` classes have been marked as final
76-
* Deprecated the `web_profiler.position` config option (in Symfony 4.0 the toolbar
77-
will always be displayed at the bottom).
7876

7977
3.3.0
8078
-----

src/Symfony/Bundle/FrameworkBundle/Console/Application.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@ protected function registerCommands()
173173
}
174174

175175
if ($container->hasParameter('console.command.ids')) {
176+
$lazyCommandIds = $container->hasParameter('console.lazy_command.ids') ? $container->getParameter('console.lazy_command.ids') : array();
176177
foreach ($container->getParameter('console.command.ids') as $id) {
177-
if (false !== $id) {
178+
if (!isset($lazyCommandIds[$id])) {
178179
try {
179180
$this->add($container->get($id));
180181
} catch (\Exception $e) {

src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,16 @@ private function getKernel(array $bundles, $useDispatcher = false)
183183
}
184184

185185
$container
186-
->expects($this->once())
186+
->expects($this->exactly(2))
187187
->method('hasParameter')
188-
->with($this->equalTo('console.command.ids'))
189-
->will($this->returnValue(true))
188+
->withConsecutive(array('console.command.ids'), array('console.lazy_command.ids'))
189+
->willReturnOnConsecutiveCalls(true, true)
190190
;
191191
$container
192-
->expects($this->once())
192+
->expects($this->exactly(2))
193193
->method('getParameter')
194-
->with($this->equalTo('console.command.ids'))
195-
->will($this->returnValue(array()))
194+
->withConsecutive(array('console.lazy_command.ids'), array('console.command.ids'))
195+
->willReturnOnConsecutiveCalls(array(), array())
196196
;
197197

198198
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock();

src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ CHANGELOG
99
* removed the `web_profiler.position` config option and the
1010
`web_profiler.debug_toolbar.position` container parameter
1111

12+
3.4.0
13+
-----
14+
15+
* Deprecated the `web_profiler.position` config option (in 4.0 version the toolbar
16+
will always be displayed at the bottom) and the `web_profiler.debug_toolbar.position`
17+
container parameter.
18+
1219
3.1.0
1320
-----
1421

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public function getDebugModes()
3636
array(array('intercept_redirects' => true), array('intercept_redirects' => true, 'toolbar' => false, 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt')),
3737
array(array('intercept_redirects' => false), array('intercept_redirects' => false, 'toolbar' => false, 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt')),
3838
array(array('toolbar' => true), array('intercept_redirects' => false, 'toolbar' => true, 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt')),
39-
array(array(), array('intercept_redirects' => false, 'toolbar' => false, 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt')),
4039
array(array('excluded_ajax_paths' => 'test'), array('intercept_redirects' => false, 'toolbar' => false, 'excluded_ajax_paths' => 'test')),
4140
);
4241
}

src/Symfony/Bundle/WebProfilerBundle/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"symfony/stopwatch": "~3.4|~4.0"
3131
},
3232
"conflict": {
33+
"symfony/config": "<3.4",
3334
"symfony/dependency-injection": "<3.4",
3435
"symfony/event-dispatcher": "<3.4",
3536
"symfony/var-dumper": "<3.4"

src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function process(ContainerBuilder $container)
4141
$lazyCommandMap = array();
4242
$lazyCommandRefs = array();
4343
$serviceIds = array();
44+
$lazyServiceIds = array();
4445

4546
foreach ($commandServices as $id => $tags) {
4647
$definition = $container->getDefinition($id);
@@ -73,7 +74,8 @@ public function process(ContainerBuilder $container)
7374
continue;
7475
}
7576

76-
$serviceIds[$commandId] = false;
77+
$serviceIds[$commandId] = $id;
78+
$lazyServiceIds[$id] = true;
7779
unset($tags[0]);
7880
$lazyCommandMap[$commandName] = $id;
7981
$lazyCommandRefs[$id] = new TypedReference($id, $class);
@@ -98,5 +100,6 @@ public function process(ContainerBuilder $container)
98100
->setArguments(array(ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap));
99101

100102
$container->setParameter('console.command.ids', $serviceIds);
103+
$container->setParameter('console.lazy_command.ids', $lazyServiceIds);
101104
}
102105
}

src/Symfony/Component/Console/Tests/DependencyInjection/AddConsoleCommandPassTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ public function testProcessRegistersLazyCommands()
7373
$this->assertSame(ContainerCommandLoader::class, $commandLoader->getClass());
7474
$this->assertSame(array('my:command' => 'my-command', 'my:alias' => 'my-command'), $commandLoader->getArgument(1));
7575
$this->assertEquals(array(array('my-command' => new ServiceClosureArgument(new TypedReference('my-command', MyCommand::class)))), $commandLocator->getArguments());
76-
$this->assertSame(array('console.command.symfony_component_console_tests_dependencyinjection_mycommand' => false), $container->getParameter('console.command.ids'));
76+
$this->assertSame(array('console.command.symfony_component_console_tests_dependencyinjection_mycommand' => 'my-command'), $container->getParameter('console.command.ids'));
77+
$this->assertSame(array('my-command' => true), $container->getParameter('console.lazy_command.ids'));
7778
$this->assertSame(array(array('setName', array('my:command')), array('setAliases', array(array('my:alias')))), $command->getMethodCalls());
7879
}
7980

@@ -95,7 +96,8 @@ public function testProcessFallsBackToDefaultName()
9596
$this->assertSame(ContainerCommandLoader::class, $commandLoader->getClass());
9697
$this->assertSame(array('default' => 'with-default-name'), $commandLoader->getArgument(1));
9798
$this->assertEquals(array(array('with-default-name' => new ServiceClosureArgument(new TypedReference('with-default-name', NamedCommand::class)))), $commandLocator->getArguments());
98-
$this->assertSame(array('console.command.symfony_component_console_tests_dependencyinjection_namedcommand' => false), $container->getParameter('console.command.ids'));
99+
$this->assertSame(array('console.command.symfony_component_console_tests_dependencyinjection_namedcommand' => 'with-default-name'), $container->getParameter('console.command.ids'));
100+
$this->assertSame(array('with-default-name' => true), $container->getParameter('console.lazy_command.ids'));
99101

100102
$container = new ContainerBuilder();
101103
$container

0 commit comments

Comments
 (0)