Skip to content

Commit 2d44230

Browse files
committed
Merge branch '2.5'
* 2.5: added missing use statements added missing use statement added missing use statement fixed CS [Process] fixed some volatile tests [HttpKernel] fixed a volatile test [HttpFoundation] fixed some volatile tests [Tests] PHPUnit Optimizations Use getPathname() instead of string casting to get BinaryFileReponse file path Conflicts: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php src/Symfony/Component/Process/Process.php src/Symfony/Component/Stopwatch/Stopwatch.php src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php src/Symfony/Component/Yaml/Parser.php src/Symfony/Component/Yaml/Tests/InlineTest.php
2 parents 3dd5376 + 09806f1 commit 2d44230

24 files changed

+40
-45
lines changed

Command/TranslationUpdateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function configure()
5959
new InputOption(
6060
'clean', null, InputOption::VALUE_NONE,
6161
'Should clean not found messages'
62-
)
62+
),
6363
))
6464
->setDescription('Updates the translation file')
6565
->setHelp(<<<EOF

Console/Descriptor/MarkdownDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ protected function describeContainerAlias(Alias $alias, array $options = array()
213213
*/
214214
protected function describeContainerParameter($parameter, array $options = array())
215215
{
216-
$this->write(isset($options['parameter']) ? sprintf("%s\n%s\n\n%s", $options['parameter'], str_repeat('=', strlen($options['parameter'])), $this->formatParameter($parameter)): $parameter);
216+
$this->write(isset($options['parameter']) ? sprintf("%s\n%s\n\n%s", $options['parameter'], str_repeat('=', strlen($options['parameter'])), $this->formatParameter($parameter)) : $parameter);
217217
}
218218

219219
/**

Routing/Router.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private function resolveParameters(RouteCollection $collection)
9090
}
9191

9292
foreach ($route->getRequirements() as $name => $value) {
93-
$route->setRequirement($name, $this->resolve($value));
93+
$route->setRequirement($name, $this->resolve($value));
9494
}
9595

9696
$route->setPath($this->resolve($route->getPath()));
@@ -138,7 +138,7 @@ private function resolve($value)
138138
}
139139

140140
throw new RuntimeException(sprintf(
141-
'The container parameter "%s", used in the route configuration value "%s", ' .
141+
'The container parameter "%s", used in the route configuration value "%s", '.
142142
'must be a string or numeric, but it is of type %s.',
143143
$match[1],
144144
$value,

Tests/CacheWarmer/TemplateFinderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,4 @@ function ($template) { return $template->getLogicalName(); },
5353
$this->assertContains('::this.is.a.template.format.engine', $templates);
5454
$this->assertContains('::resource.format.engine', $templates);
5555
}
56-
5756
}

Tests/Console/Descriptor/AbstractDescriptorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private function getContainerBuilderDescriptionTestData(array $objects)
158158
'services' => array('show_private' => true),
159159
'public' => array('show_private' => false),
160160
'tag1' => array('show_private' => true, 'tag' => 'tag1'),
161-
'tags' => array('group_by' => 'tags', 'show_private' => true)
161+
'tags' => array('group_by' => 'tags', 'show_private' => true),
162162
);
163163

164164
$data = array();

Tests/Console/Descriptor/ObjectsProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static function getContainerParameter()
7373
$builder->setParameter('database_name', 'symfony');
7474

7575
return array(
76-
'parameter' => $builder
76+
'parameter' => $builder,
7777
);
7878
}
7979

@@ -143,7 +143,7 @@ public static function getCallables()
143143
'callable_4' => 'Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass::staticMethod',
144144
'callable_5' => array('Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\ExtendedCallableClass', 'parent::staticMethod'),
145145
'callable_6' => function () { return 'Closure'; },
146-
'callable_7' => new CallableClass()
146+
'callable_7' => new CallableClass(),
147147
);
148148
}
149149
}

Tests/Controller/ControllerResolverTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ public function getUndefinedControllers()
115115
array(
116116
'Symfony\Component\HttpKernel\Tests\Controller\ControllerResolverTest::bar',
117117
'\InvalidArgumentException',
118-
'Controller "Symfony\Component\HttpKernel\Tests\Controller\ControllerResolverTest::bar" for URI "/" is not callable.'
119-
)
118+
'Controller "Symfony\Component\HttpKernel\Tests\Controller\ControllerResolverTest::bar" for URI "/" is not callable.',
119+
),
120120
);
121121
}
122122

Tests/Controller/RedirectControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testRoute($permanent, $ignoreAttributes, $expectedCode, $expecte
6060
'route' => $route,
6161
'permanent' => $permanent,
6262
'additional-parameter' => 'value',
63-
'ignoreAttributes' => $ignoreAttributes
63+
'ignoreAttributes' => $ignoreAttributes,
6464
),
6565
);
6666

Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function testThatCacheWarmersAreProcessedInPriorityOrder()
2323
$services = array(
2424
'my_cache_warmer_service1' => array(0 => array('priority' => 100)),
2525
'my_cache_warmer_service2' => array(0 => array('priority' => 200)),
26-
'my_cache_warmer_service3' => array()
26+
'my_cache_warmer_service3' => array(),
2727
);
2828

2929
$definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
@@ -46,7 +46,7 @@ public function testThatCacheWarmersAreProcessedInPriorityOrder()
4646
->with(0, array(
4747
new Reference('my_cache_warmer_service2'),
4848
new Reference('my_cache_warmer_service1'),
49-
new Reference('my_cache_warmer_service3')
49+
new Reference('my_cache_warmer_service3'),
5050
));
5151

5252
$addCacheWarmerPass = new AddCacheWarmerPass();

Tests/DependencyInjection/Compiler/AddConsoleCommandPassTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,4 @@ public function testProcessThrowAnExceptionIfTheServiceIsNotASubclassOfCommand()
9191

9292
class MyCommand extends Command
9393
{
94-
9594
}

Tests/DependencyInjection/Compiler/SerializerPassTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
*/
2323
class SerializerPassTest extends \PHPUnit_Framework_TestCase
2424
{
25-
2625
public function testThrowExceptionWhenNoNormalizers()
2726
{
2827
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
@@ -72,16 +71,16 @@ public function testThrowExceptionWhenNoEncoders()
7271

7372
public function testServicesAreOrderedAccordingToPriority()
7473
{
75-
$services = array(
74+
$services = array(
7675
'n3' => array('tag' => array()),
7776
'n1' => array('tag' => array('priority' => 200)),
78-
'n2' => array('tag' => array('priority' => 100))
77+
'n2' => array('tag' => array('priority' => 100)),
7978
);
8079

81-
$expected = array(
80+
$expected = array(
8281
new Reference('n1'),
8382
new Reference('n2'),
84-
new Reference('n3')
83+
new Reference('n3'),
8584
);
8685

8786
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');

Tests/DependencyInjection/Compiler/TranslatorPassTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ public function testValidCollector()
4040
$container->expects($this->once())
4141
->method('findDefinition')
4242
->will($this->returnValue($this->getMock('Symfony\Component\DependencyInjection\Definition')));
43-
;
44-
4543
$pass = new TranslatorPass();
4644
$pass->process($container);
4745
}

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testValidTrustedProxies($trustedProxies, $processedProxies)
3636
$configuration = new Configuration();
3737
$config = $processor->processConfiguration($configuration, array(array(
3838
'secret' => 's3cr3t',
39-
'trusted_proxies' => $trustedProxies
39+
'trusted_proxies' => $trustedProxies,
4040
)));
4141

4242
$this->assertEquals($processedProxies, $config['trusted_proxies']);
@@ -66,8 +66,8 @@ public function testInvalidTypeTrustedProxies()
6666
$processor->processConfiguration($configuration, array(
6767
array(
6868
'secret' => 's3cr3t',
69-
'trusted_proxies' => 'Not an IP address'
70-
)
69+
'trusted_proxies' => 'Not an IP address',
70+
),
7171
));
7272
}
7373

@@ -81,8 +81,8 @@ public function testInvalidValueTrustedProxies()
8181
$processor->processConfiguration($configuration, array(
8282
array(
8383
'secret' => 's3cr3t',
84-
'trusted_proxies' => array('Not an IP address')
85-
)
84+
'trusted_proxies' => array('Not an IP address'),
85+
),
8686
));
8787
}
8888

@@ -138,7 +138,7 @@ protected static function getBundleDefaultConfig()
138138
'debug' => '%kernel.debug%',
139139
),
140140
'serializer' => array(
141-
'enabled' => false
141+
'enabled' => false,
142142
),
143143
'property_access' => array(
144144
'magic_call' => false,

Tests/DependencyInjection/Fixtures/TestBundle/TestBundle.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313

1414
class TestBundle extends \Symfony\Component\HttpKernel\Bundle\Bundle
1515
{
16-
1716
}

Tests/DependencyInjection/Fixtures/php/form_csrf_sets_field_name.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
$container->loadFromExtension('framework', array(
44
'csrf_protection' => array(
55
'enabled' => true,
6-
'field_name' => '_custom'
6+
'field_name' => '_custom',
77
),
88
'form' => array(
99
'enabled' => true,

Tests/DependencyInjection/Fixtures/php/form_csrf_under_form_sets_field_name.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
$container->loadFromExtension('framework', array(
44
'csrf_protection' => array(
55
'enabled' => true,
6-
'field_name' => '_custom'
6+
'field_name' => '_custom',
77
),
88
'form' => array(
99
'enabled' => true,
1010
'csrf_protection' => array(
11-
'field_name' => '_custom_form'
11+
'field_name' => '_custom_form',
1212
),
1313
),
1414
'session' => array(

Tests/DependencyInjection/Fixtures/php/full.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
),
5555
),
5656
'form' => array(
57-
'resources' => array('theme1', 'theme2')
57+
'resources' => array('theme1', 'theme2'),
5858
),
5959
'hinclude_default_template' => 'global_hinclude_template',
6060
),
@@ -78,7 +78,7 @@
7878
'text/csv',
7979
'text/plain',
8080
),
81-
'pdf' => 'application/pdf'
82-
)
83-
)
81+
'pdf' => 'application/pdf',
82+
),
83+
),
8484
));

Tests/Functional/Bundle/TestBundle/Controller/SessionController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class SessionController extends ContainerAware
2020
{
21-
public function welcomeAction(Request $request, $name=null)
21+
public function welcomeAction(Request $request, $name = null)
2222
{
2323
$session = $request->getSession();
2424

Tests/Routing/RouterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function testGenerateWithServiceParam()
2424
$routes->add('foo', new Route(
2525
' /{_locale}',
2626
array(
27-
'_locale' => '%locale%'
27+
'_locale' => '%locale%',
2828
),
2929
array(
3030
'_locale' => 'en|es',

Tests/Templating/DelegatingEngineTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testSupportsRetrievesEngineFromTheContainer()
1919
{
2020
$container = $this->getContainerMock(array(
2121
'engine.first' => $this->getEngineMock('template.php', false),
22-
'engine.second' => $this->getEngineMock('template.php', true)
22+
'engine.second' => $this->getEngineMock('template.php', true),
2323
));
2424

2525
$delegatingEngine = new DelegatingEngine($container, array('engine.first', 'engine.second'));
@@ -33,7 +33,7 @@ public function testGetExistingEngine()
3333
$secondEngine = $this->getEngineMock('template.php', true);
3434
$container = $this->getContainerMock(array(
3535
'engine.first' => $firstEngine,
36-
'engine.second' => $secondEngine
36+
'engine.second' => $secondEngine,
3737
));
3838

3939
$delegatingEngine = new DelegatingEngine($container, array('engine.first', 'engine.second'));
@@ -51,7 +51,7 @@ public function testGetInvalidEngine()
5151
$secondEngine = $this->getEngineMock('template.php', false);
5252
$container = $this->getContainerMock(array(
5353
'engine.first' => $firstEngine,
54-
'engine.second' => $secondEngine
54+
'engine.second' => $secondEngine,
5555
));
5656

5757
$delegatingEngine = new DelegatingEngine($container, array('engine.first', 'engine.second'));

Tests/Templating/Helper/FormHelperDivLayoutTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ protected function setTheme(FormView $view, array $themes)
112112
public static function themeBlockInheritanceProvider()
113113
{
114114
return array(
115-
array(array('TestBundle:Parent'))
115+
array(array('TestBundle:Parent')),
116116
);
117117
}
118118

119119
public static function themeInheritanceProvider()
120120
{
121121
return array(
122-
array(array('TestBundle:Parent'), array('TestBundle:Child'))
122+
array(array('TestBundle:Parent'), array('TestBundle:Child')),
123123
);
124124
}
125125
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
<?php if (!$label) { $label = $view['form']->humanize($name); } ?>
1+
<?php if (!$label) {
2+
$label = $view['form']->humanize($name);
3+
} ?>
24
<label>Custom label: <?php echo $view->escape($view['translator']->trans($label, array(), $translation_domain)) ?></label>

Tests/Translation/TranslatorTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ public function testGetLocaleWithInvalidLocale()
175175
$this->assertSame('en-US', $translator->getLocale());
176176
}
177177

178-
179178
protected function getCatalogue($locale, $messages)
180179
{
181180
$catalogue = new MessageCatalogue($locale);

Translation/PhpStringTokenParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public static function parse($str)
9696
public static function parseEscapeSequences($str, $quote)
9797
{
9898
if (null !== $quote) {
99-
$str = str_replace('\\' . $quote, $quote, $str);
99+
$str = str_replace('\\'.$quote, $quote, $str);
100100
}
101101

102102
return preg_replace_callback(

0 commit comments

Comments
 (0)