Skip to content

Commit 6f2a31b

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: [HttpFoundation] Use the correct syntax for session gc based on Pdo driver Revert "bug symfony#24987 [Console] Fix global console flag when used in chain (Simperfit)" Revert "bug symfony#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 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 7589493 + d007bbd commit 6f2a31b

File tree

24 files changed

+111
-44
lines changed

24 files changed

+111
-44
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ public function __construct(KernelInterface $kernel)
3535

3636
parent::__construct('Symfony', Kernel::VERSION.' - '.$kernel->getName().'/'.$kernel->getEnvironment().($kernel->isDebug() ? '/debug' : ''));
3737

38-
$this->getDefinition()->addOption(new InputOption('--shell', '-s', InputOption::VALUE_NONE, 'Launch the shell.'));
39-
$this->getDefinition()->addOption(new InputOption('--process-isolation', null, InputOption::VALUE_NONE, 'Launch commands from shell as a separate process.'));
40-
$this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', $kernel->getEnvironment()));
41-
$this->getDefinition()->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode.'));
38+
$inputDefinition = $this->getDefinition();
39+
$inputDefinition->addOption(new InputOption('--shell', '-s', InputOption::VALUE_NONE, 'Launch the shell.'));
40+
$inputDefinition->addOption(new InputOption('--process-isolation', null, InputOption::VALUE_NONE, 'Launch commands from shell as a separate process.'));
41+
$inputDefinition->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', $kernel->getEnvironment()));
42+
$inputDefinition->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode.'));
4243
}
4344

4445
/**

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ protected function write($content, $decorated = false)
110110
protected function renderTable(Table $table, $decorated = false)
111111
{
112112
if (!$decorated) {
113-
$table->getStyle()->setCellRowFormat('%s');
114-
$table->getStyle()->setCellRowContentFormat('%s');
115-
$table->getStyle()->setCellHeaderFormat('%s');
113+
$tableStyle = $table->getStyle();
114+
$tableStyle->setCellRowFormat('%s');
115+
$tableStyle->setCellRowContentFormat('%s');
116+
$tableStyle->setCellHeaderFormat('%s');
116117
}
117118

118119
$table->render();

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,9 @@ private function registerTemplatingConfiguration(array $config, $ide, ContainerB
471471
if (1 === count($engines)) {
472472
$container->setAlias('templating', (string) reset($engines));
473473
} else {
474+
$templateEngineDefinition = $container->getDefinition('templating.engine.delegating');
474475
foreach ($engines as $engine) {
475-
$container->getDefinition('templating.engine.delegating')->addMethodCall('addEngine', array($engine));
476+
$templateEngineDefinition->addMethodCall('addEngine', array($engine));
476477
}
477478
$container->setAlias('templating', 'templating.engine.delegating');
478479
}

src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ public function __construct(HttpKernelInterface $kernel, $cacheDir = null)
5252
protected function forward(Request $request, $raw = false, Response $entry = null)
5353
{
5454
$this->getKernel()->boot();
55-
$this->getKernel()->getContainer()->set('cache', $this);
56-
$this->getKernel()->getContainer()->set($this->getSurrogate()->getName(), $this->getSurrogate());
55+
$container = $this->getKernel()->getContainer();
56+
$container->set('cache', $this);
57+
$container->set($this->getSurrogate()->getName(), $this->getSurrogate());
5758

5859
return parent::forward($request, $raw, $entry);
5960
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
<tag name="monolog.logger" channel="request" />
143143
<argument>%twig.exception_listener.controller%</argument>
144144
<argument type="service" id="logger" on-invalid="null" />
145+
<argument>%kernel.debug%</argument>
145146
</service>
146147

147148
<service id="twig.controller.exception" class="%twig.controller.exception.class%">

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -284,16 +284,6 @@ public function hasParameterOption($values)
284284
if ($token === $value || 0 === strpos($token, $value.'=')) {
285285
return true;
286286
}
287-
288-
if (0 === strpos($token, '-') && 0 !== strpos($token, '--')) {
289-
$noValue = explode('=', $token);
290-
$token = $noValue[0];
291-
$searchableToken = str_replace('-', '', $token);
292-
$searchableValue = str_replace('-', '', $value);
293-
if ('' !== $searchableToken && '' !== $searchableValue && false !== strpos($searchableToken, $searchableValue)) {
294-
return true;
295-
}
296-
}
297287
}
298288
}
299289

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,6 @@ public function testHasParameterOption()
296296
$input = new ArgvInput(array('cli.php', '-f', 'foo'));
297297
$this->assertTrue($input->hasParameterOption('-f'), '->hasParameterOption() returns true if the given short option is in the raw input');
298298

299-
$input = new ArgvInput(array('cli.php', '-fh'));
300-
$this->assertTrue($input->hasParameterOption('-fh'), '->hasParameterOption() returns true if the given short option is in the raw input');
301-
302-
$input = new ArgvInput(array('cli.php', '-e=test'));
303-
$this->assertFalse($input->hasParameterOption('-s'), '->hasParameterOption() returns true if the given short option is in the raw input');
304-
305299
$input = new ArgvInput(array('cli.php', '--foo', 'foo'));
306300
$this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given short option is in the raw input');
307301

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,16 @@ public function addClassResource(\ReflectionClass $class)
276276
* @throws BadMethodCallException When this ContainerBuilder is frozen
277277
* @throws \LogicException if the container is frozen
278278
*/
279-
public function loadFromExtension($extension, array $values = array())
279+
public function loadFromExtension($extension, array $values = null)
280280
{
281281
if ($this->isFrozen()) {
282282
throw new BadMethodCallException('Cannot load from an extension on a frozen container.');
283283
}
284284

285+
if (func_num_args() < 2) {
286+
$values = array();
287+
}
288+
285289
$namespace = $this->getExtension($extension)->getAlias();
286290

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ private function loadFromExtensions(array $content)
459459
continue;
460460
}
461461

462-
if (!is_array($values)) {
462+
if (!is_array($values) && null !== $values) {
463463
$values = array();
464464
}
465465

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

Lines 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)