8000 Merge branch '3.4' into 4.0 · symfony/symfony@50d86e8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 50d86e8

Browse files
committed
Merge branch '3.4' into 4.0
* 3.4: [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 Restore RoleInterface import [Console] Provide a bugfix where an array could be passed Improve assertions SCA: get rid of repetitive calls allow null values for root nodes in YAML configs revert useless tests fixtures changes [VarDumper] Fix docblock Improve phpdoc to make it more explicit [DI] Fix initialization of legacy containers by delaying include_once
2 parents 9bd28fc + d5ff094 commit 50d86e8

File tree

40 files changed

+244
-157
lines changed

40 files changed

+244
-157
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ public function __construct(KernelInterface $kernel)
3939

4040
parent::__construct('Symfony', Kernel::VERSION);
4141

42-
$this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The environment name', $kernel->getEnvironment()));
43-
$this->getDefinition()->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode'));
42+
$inputDefinition = $this->getDefinition();
43+
$inputDefinition->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', $kernel->getEnvironment()));
44+
$inputDefinition->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode.'));
4445
}
4546

4647
/**

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,8 +741,9 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder
741741
if (1 === count($engines)) {
742742
$container->setAlias('templating', (string) reset($engines))->setPublic(true);
743743
} else {
744+
$templateEngineDefinition = $container->getDefinition('templating.engine.delegating');
744745
foreach ($engines as $engine) {
745-
$container->getDefinition('templating.engine.delegating')->addMethodCall('addEngine', array($engine));
746+
$templateEngineDefinition->addMethodCall('addEngine', array($engine));
746747
}
747748
$container->setAlias('templating', 'templating.engine.delegating')->setPublic(true);
748749
}

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_no_assets.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<?php
22

33
$container->loadFromExtension('framework', array(
4-
'assets' => array(
5-
'enabled' => true,
6-
),
74
'templating' => array(
85
'engines' => array('php', 'twig'),
96
),

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/templating_no_assets.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
77

88
<framework:config>
9-
<framework:assets enabled="true" />
109
<framework:templating>
1110
<framework:engine>php</framework:engine>
1211
<framework:engine>twig</framework:engine>
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
framework:
2-
assets:
3-
enabled: true
42
templating:
53
engines: [php, twig]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ public function testCsrfAliases()
8686
$processor = new Processor();
8787
$configuration = new MainConfiguration(array(), array());
8888
$processedConfig = $processor->processConfiguration($configuration, array($config));
89-
$this->assertTrue(isset($processedConfig['firewalls']['stub']['logout']['csrf_token_generator']));
89+
$this->assertArrayHasKey('csrf_token_generator', $processedConfig['firewalls']['stub']['logout']);
9090
$this->assertEquals('a_token_generator', $processedConfig['firewalls']['stub']['logout'][' F438 csrf_token_generator']);
91-
$this->assertTrue(isset($processedConfig['firewalls']['stub']['logout']['csrf_token_id']));
91+
$this->assertArrayHasKey('csrf_token_id', $processedConfig['firewalls']['stub']['logout']);
9292
$this->assertEquals('a_token_id', $processedConfig['firewalls']['stub']['logout']['csrf_token_id']);
9393
}
9494

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
<tag name="monolog.logger" channel="request" />
129129
<argument>%twig.exception_listener.controller%</argument>
130130
<argument type="service" id="logger" on-invalid="null" />
131+
<argument>%kernel.debug%</argument>
131132
</service>
132133

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

src/Symfony/Component/Console/Helper/Table.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,16 @@ private function buildTableRows($rows)
442442

443443
/**
444444
* fill rows that contains rowspan > 1.
445+
*
446+
* @throws InvalidArgumentException
445447
*/
446448
private function fillNextRows(array $rows, int $line): array
447449
{
448450
$unmergedRows = array();
449451
foreach ($rows[$line] as $column => $cell) {
452+
if (null !== $cell && !$cell instanceof TableCell && !is_scalar($cell) && !(is_object($cell) && method_exists($cell, '__toString'))) {
453+
throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing __toString, %s given.', gettype($cell)));
454+
}
450455
if ($cell instanceof TableCell && $cell->getRowspan() > 1) {
451456
$nbLines = $cell->getRowspan() - 1;
452457
$lines = array($cell);

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -280,16 +280,6 @@ public function hasParameterOption($values, $onlyParams = false)
280280
if ($token === $value || 0 === strpos($token, $value.'=')) {
281281
return true;
282282
}
283-
284-
if (0 === strpos($token, '-') && 0 !== strpos($token, '--')) {
285-
$noValue = explode('=', $token);
286-
$token = $noValue[0];
287-
$searchableToken = str_replace('-', '', $token);
288-
$searchableValue = str_replace('-', '', $value);
289-
if ('' !== $searchableToken && '' !== $searchableValue && false !== strpos($searchableToken, $searchableValue)) {
290-
return true;
291-
}
292-
}
293283
}
294284
}
295285

src/Symfony/Component/Console/Tests/Helper/TableTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,22 @@ public function testColumnStyle()
726726
$this->assertEquals($expected, $this->getOutputContent($output));
727727
}
728728

729+
/**
730+
* @expectedException \Symfony\Component\Console\Exception\InvalidArgumentException
731+
* @expectedExceptionMessage A cell must be a TableCell, a scalar or an object implementing __toString, array given.
732+
*/
733+
public function testThrowsWhenTheCellInAnArray()
734+
{
735+
$table = new Table($output = $this->getOutputStream());
736+
$table
737+
->setHeaders(array('ISBN', 'Title', 'Author', 'Price'))
738+
->setRows(array(
739+
array('99921-58-10-7', array(), 'Dante Alighieri', '9.95'),
740+
));
741+
742+
$table->render();
743+
}
744+
729745
public function testColumnWith()
730746
{
731747
$table = new Table($output = $this->getOutputStream());

0 commit comments

Comments
 (0)
0