Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 57e5075

Browse filesBrowse files
committed
Merge branch '2.8' into 3.3
* 2.8: [HttpFoundation] Use the correct syntax for session gc based on Pdo driver Removed assertDateTimeEquals() methods. Revert "bug #24987 [Console] Fix global console flag when used in chain (Simperfit)" Revert "bug #25487 [Console] Fix a bug when passing a letter that could be an alias (Simperfit)" Disable CSP header on exception pages only in debug Fixed submitting disabled buttons Fixed Button::setParent() when already submitted Improve assertions Improve assertions SCA: get rid of repetitive calls allow null values for root nodes in YAML configs [VarDumper] Fix docblock Improve phpdoc to make it more explicit
2 parents 5f537e4 + 9606f02 commit 57e5075
Copy full SHA for 57e5075

File tree

Expand file treeCollapse file tree

32 files changed

+145
-102
lines changed
Filter options
Expand file treeCollapse file tree

32 files changed

+145
-102
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Application.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ public function __construct(KernelInterface $kernel)
3535

3636
parent::__construct('Symfony', Kernel::VERSION);
3737

38-
$this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The environment name', $kernel->getEnvironment()));
39-
$this->getDefinition()->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode'));
38+
$inputDefinition = $this->getDefinition();
39+
$inputDefinition->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', $kernel->getEnvironment()));
40+
$inputDefinition->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode.'));
4041
}
4142

4243
/**

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,9 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder
758758
if (1 === count($engines)) {
759759
$container->setAlias('templating', (string) reset($engines));
760760
} else {
761+
$templateEngineDefinition = $container->getDefinition('templating.engine.delegating');
761762
foreach ($engines as $engine) {
762-
$container->getDefinition('templating.engine.delegating')->addMethodCall('addEngine', array($engine));
763+
$templateEngineDefinition->addMethodCall('addEngine', array($engine));
763764
}
764765
$container->setAlias('templating', 'templating.engine.delegating');
765766
}

‎src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/MainConfigurationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/MainConfigurationTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ public function testCsrfAliases()
8484
$processor = new Processor();
8585
$configuration = new MainConfiguration(array(), array());
8686
$processedConfig = $processor->processConfiguration($configuration, array($config));
87-
$this->assertTrue(isset($processedConfig['firewalls']['stub']['logout']['csrf_token_generator']));
87+
$this->assertArrayHasKey('csrf_token_generator', $processedConfig['firewalls']['stub']['logout']);
8888
$this->assertEquals('a_token_generator', $processedConfig['firewalls']['stub']['logout']['csrf_token_generator']);
89-
$this->assertTrue(isset($processedConfig['firewalls']['stub']['logout']['csrf_token_id']));
89+
$this->assertArrayHasKey('csrf_token_id', $processedConfig['firewalls']['stub']['logout']);
9090
$this->assertEquals('a_token_id', $processedConfig['firewalls']['stub']['logout']['csrf_token_id']);
9191
}
9292

‎src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
<tag name="monolog.logger" channel="request" />
126126
<argument>%twig.exception_listener.controller%</argument>
127127
<argument type="service" id="logger" on-invalid="null" />
128+
<argument>%kernel.debug%</argument>
128129
</service>
129130

130131
<service id="twig.controller.exception" class="Symfony\Bundle\TwigBundle\Controller\ExceptionController" public="true">

‎src/Symfony/Component/Console/Input/ArgvInput.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Input/ArgvInput.php
-10Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -285,16 +285,6 @@ public function hasParameterOption($values, $onlyParams = false)
285285
if ($token === $value || 0 === strpos($token, $value.'=')) {
286286
return true;
287287
}
288-
289-
if (0 === strpos($token, '-') && 0 !== strpos($token, '--')) {
290-
$noValue = explode('=', $token);
291-
$token = $noValue[0];
292-
$searchableToken = str_replace('-', '', $token);
293-
$searchableValue = str_replace('-', '', $value);
294-
if ('' !== $searchableToken && '' !== $searchableValue && false !== strpos($searchableToken, $searchableValue)) {
295-
return true;
296-
}
297-
}
298288
}
299289
}
300290

‎src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,6 @@ public function testHasParameterOption()
314314
$input = new ArgvInput(array('cli.php', '-f', 'foo'));
315315
$this->assertTrue($input->hasParameterOption('-f'), '->hasParameterOption() returns true if the given short option is in the raw input');
316316

317-
$input = new ArgvInput(array('cli.php', '-fh'));
318-
$this->assertTrue($input->hasParameterOption('-fh'), '->hasParameterOption() returns true if the given short option is in the raw input');
319-
320-
$input = new ArgvInput(array('cli.php', '-e=test'));
321-
$this->assertFalse($input->hasParameterOption('-s'), '->hasParameterOption() returns true if the given short option is in the raw input');
322-
323317
$input = new ArgvInput(array('cli.php', '--foo', 'foo'));
324318
$this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given short option is in the raw input');
325319

‎src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/ContainerBuilder.php
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,12 +419,16 @@ public function fileExists($path, $trackContents = true)
419419
* @throws BadMethodCallException When this ContainerBuilder is compiled
420420
* @throws \LogicException if the extension is not registered
421421
*/
422-
public function loadFromExtension($extension, array $values = array())
422+
public function loadFromExtension($extension, array $values = null)
423423
{
424424
if ($this->isCompiled()) {
425425
throw new BadMethodCallException('Cannot load from an extension on a compiled container.');
426426
}
427427

428+
if (func_num_args() < 2) {
429+
$values = array();
430+
}
431+
428432
$namespace = $this->getExtension($extension)->getAlias();
429433

430434
$this->extensionConfigs[$namespace][] = $values;

‎src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ private function loadFromExtensions(array $content)
755755
continue;
756756
}
757757

758-
if (!is_array($values)) {
758+
if (!is_array($values) && null !== $values) {
759759
$values = array();
760760
}
761761

‎src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,23 +259,23 @@ public function testDeepDefinitionsResolving()
259259
$this->process($container);
260260

261261
$configurator = $container->getDefinition('sibling')->getConfigurator();
262-
$this->assertSame('Symfony\Component\DependencyInjection\Definition', get_class($configurator));
262+
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $configurator);
263263
$this->assertSame('parentClass', $configurator->getClass());
264264

265265
$factory = $container->getDefinition('sibling')->getFactory();
266-
$this->assertSame('Symfony\Component\DependencyInjection\Definition', get_class($factory[0]));
266+
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $factory[0]);
267267
$this->assertSame('parentClass', $factory[0]->getClass());
268268

269269
$argument = $container->getDefinition('sibling')->getArgument(0);
270-
$this->assertSame('Symfony\Component\DependencyInjection\Definition', get_class($argument));
270+
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $argument);
271271
$this->assertSame('parentClass', $argument->getClass());
272272

273273
$properties = $container->getDefinition('sibling')->getProperties();
274-
$this->assertSame('Symfony\Component\DependencyInjection\Definition', get_class($properties['prop']));
274+
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $properties['prop']);
275275
$this->assertSame('parentClass', $properties['prop']->getClass());
276276

277277
$methodCalls = $container->getDefinition('sibling')->getMethodCalls();
278-
$this->assertSame('Symfony\Component\DependencyInjection\Definition', get_class($methodCalls[0][1][0]));
278+
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $methodCalls[0][1][0]);
279279
$this->assertSame('parentClass', $methodCalls[0][1][0]->getClass());
280280
}
281281

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ class ProjectExtension implements ExtensionInterface
88
{
99
public function load(array $configs, ContainerBuilder $configuration)
1010
{
11-
$config = call_user_func_array('array_merge', $configs);
11+
$configuration->setParameter('project.configs', $configs);
12+
$configs = array_filter($configs);
13+
14+
if ($configs) {
15+
$config = call_user_func_array('array_merge', $configs);
16+
} else {
17+
$config = array();
18+
}
1219

1320
$configuration->setDefinition('project.service.bar', new Definition('FooClass'));
1421
$configuration->setParameter('project.parameter.bar', isset($config['foo']) ? $config['foo'] : 'foobar');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.