8000 Merge branch '2.7' · symfony/symfony@88d88de · GitHub
[go: up one dir, main page]

Skip to content

Commit 88d88de

Browse files
committed
Merge branch '2.7'
* 2.7: [FrameworkBundle] fix routing descriptor for options exit when Twig environment is not set [Routing] fix misleading test for condition [Debug] fix test
2 parents 6a6d9c3 + d752f74 commit 88d88de

File tree

13 files changed

+45
-14
lines changed

13 files changed

+45
-14
lines changed

src/Symfony/Bridge/Twig/Command/LintCommand.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ protected function configure()
8383
protected function execute(InputInterface $input, OutputInterface $output)
8484
{
8585
$twig = $this->getTwigEnvironment();
86+
87+
if (null === $twig) {
88+
$output->writeln('<error>The Twig environment needs to be set.</error>');
89+
90+
return 1;
91+
}
92+
8693
$filename = $input->getArgument('filename');
8794

8895
if (!$filename) {

src/Symfony/Bundle/DebugBundle/Resources/meta/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2004-2015 Fabien Potencier
1+
Copyright (c) 2014-2015 Fabien Potencier
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function describeRoute(Route $route, array $options = array())
6060
."\n".'- Method: '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY')
6161
."\n".'- Class: '.get_class($route)
6262
."\n".'- Defaults: '.$this->formatRouterConfig($route->getDefaults())
63-
."\n".'- Requirements: '.$this->formatRouterConfig($requirements) ?: 'NONE'
63+
."\n".'- Requirements: '.($requirements ? $this->formatRouterConfig($requirements) : 'NO CUSTOM')
6464
."\n".'- Options: '.$this->formatRouterConfig($route->getOptions());
6565

6666
$this->write(isset($options['name'])

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected function describeRoute(Route $route, array $options = array())
8383
'<comment>Method</comment> '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY'),
8484
'<comment>Class</comment> '.get_class($route),
8585
'<comment>Defaults</comment> '.$this->formatRouterConfig($route->getDefaults()),
86-
'<comment>Requirements</comment> '.$this->formatRouterConfig($requirements) ?: 'NO CUSTOM',
86+
'<comment>Requirements</comment> '.($requirements ? $this->formatRouterConfig($requirements) : 'NO CUSTOM'),
8787
'<comment>Options</comment> '.$this->formatRouterConfig($route->getOptions()),
8888
);
8989

@@ -378,6 +378,10 @@ protected function describeCallable($callable, array $options = array())
378378
*/
379379
private function formatRouterConfig(array $array)
380380
{
381+
if (!count($array)) {
382+
return 'NONE';
383+
}
384+
381385
$string = '';
382386
ksort($array);
383387
foreach ($array as $name => $value) {

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@
99
- `name`: Joseph
1010
- Requirements:
1111
- `name`: [a-z]+
12+
- Options:
13+
- `compiler_class`: Symfony\Component\Routing\RouteCompiler
14+
- `opt1`: val1
15+
- `opt2`: val2

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@
66
- Method: PUT|POST
77
- Class: Symfony\Component\Routing\Route
88
- Defaults: NONE
9-
- Requirements: NONE
9+
- Requirements: NO CUSTOM
10+
- Options:
11+
- `compiler_class`: Symfony\Component\Routing\RouteCompiler
12+
- `opt1`: val1
13+
- `opt2`: val2

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<comment>Scheme</comment> http|https
66
<comment>Method</comment> PUT|POST
77
<comment>Class</comment> Symfony\Component\Routing\Route
8-
<comment>Defaults</comment>
9-
<comment>Requirements</comment>
8+
<comment>Defaults</comment> NONE
9+
<comment>Requirements</comment> NO CUSTOM
1010
<comment>Options</comment> compiler_class: Symfony\Component\Routing\RouteCompiler
1111
opt1: val1
1212
opt2: val2

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ route_1
1212
- `name`: Joseph
1313
- Requirements:
1414
- `name`: [a-z]+
15+
- Options:
16+
- `compiler_class`: Symfony\Component\Routing\RouteCompiler
17+
- `opt1`: val1
18+
- `opt2`: val2
1519

1620

1721
route_2
@@ -25,5 +29,8 @@ route_2
2529
- Method: PUT|POST
2630
- Class: Symfony\Component\Routing\Route
2731
- Defaults: NONE
28-
- Requirements: NONE
29-
32+
- Requirements: NO CUSTOM
33+
- Options:
34+
- `compiler_class`: Symfony\Component\Routing\RouteCompiler
35+
- `opt1`: val1
36+
- `opt2`: val2

src/Symfony/Component/HttpKernel/Tests/DataCollector/DumpDataCollectorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public function testDump()
4949
);
5050
$this->assertEquals($xDump, $dump);
5151

52-
$this->assertStringStartsWith(
53-
'a:1:{i:0;a:5:{s:4:"data";O:39:"Symfony\Component\VarDumper\Cloner\Data":4:{s:45:"Symfony\Component\VarDumper\Cloner\Datadata";a:1:{i:0;a:1:{i:0;i:123;}}s:49:"Symfony\Component\VarDumper\Cloner\DatamaxDepth";i:20;s:57:"Symfony\Component\VarDumper\Cloner\DatamaxItemsPerDepth";i:-1;s:54:"Symfony\Component\VarDumper\Cloner\DatauseRefHandles";i:-1;}s:4:"name";s:25:"DumpDataCollectorTest.php";s:4:"file";s:',
52+
$this->assertStringMatchesFormat(
53+
'a:1:{i:0;a:5:{s:4:"data";O:39:"Symfony\Component\VarDumper\Cloner\Data":4:{s:45:"Symfony\Component\VarDumper\Cloner\Datadata";a:1:{i:0;a:1:{i:0;i:123;}}s:49:"Symfony\Component\VarDumper\Cloner\DatamaxDepth";i:%i;s:57:"Symfony\Component\VarDumper\Cloner\DatamaxItemsPerDepth";i:%i;s:54:"Symfony\Component\VarDumper\Cloner\DatauseRefHandles";i:%i;}s:4:"name";s:25:"DumpDataCollectorTest.php";s:4:"file";s:%a',
5454
str_replace("\0", '', $collector->serialize())
5555
);
5656

src/Symfony/Component/Routing/Tests/RouteTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ public function testLegacyMethodRequirement()
208208
public function testCondition()
209209
{
210210
$route = new Route('/');
211-
$this->assertEquals(null, $route->getCondition());
211+
$this->assertSame('', $route->getCondition());
212212
$route->setCondition('context.getMethod() == "GET"');
213-
$this->assertEquals('context.getMethod() == "GET"', $route->getCondition());
213+
$this->assertSame('context.getMethod() == "GET"', $route->getCondition());
214214
}
215215

216216
public function testCompile()

src/Symfony/Component/VarDumper/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2004-2015 Fabien Potencier
1+
Copyright (c) 2014-2015 Fabien Potencier
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

src/Symfony/Component/VarDumper/Tests/CliDumperTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function testSpecialVars56()
132132

133133
$this->assertSame(
134134
<<<EOTXT
135-
array:2 [
135+
array:3 [
136136
0 => array:1 [
137137
0 => &1 array:1 [
138138
0 => &1 array:1 [&1]
@@ -143,6 +143,7 @@ public function testSpecialVars56()
143143
"GLOBALS" => &2 array:1 [&2]
144144
]
145145
]
146+
2 => &2 array:1 [&2]
146147
]
147148
148149
EOTXT

src/Symfony/Component/VarDumper/composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
{
1010
"name": "Nicolas Grekas",
1111
"email": "p@tchwork.com"
12+
},
13+
{
14+
"name": "Symfony Community",
15+
"homepage": "http://symfony.com/contributors"
1216
}
1317
],
1418
"require": {

0 commit comments

Comments
 (0)
0