From 42862c4668561043b9a0aeda37e0785edb1d8d3d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 21 Jan 2016 07:28:40 +0100 Subject: [PATCH] fixed CS --- .../Extension/TranslationExtensionTest.php | 12 ++-- .../Component/Finder/Tests/FinderTest.php | 3 +- .../Session/Attribute/AttributeBagTest.php | 3 +- .../Attribute/NamespacedAttributeBagTest.php | 3 +- .../Routing/Tests/RouteCompilerTest.php | 68 +++++++++++-------- .../Component/Serializer/Serializer.php | 2 - .../Translation/Tests/fixtures/resources.php | 2 +- src/Symfony/Component/Yaml/Escaper.php | 4 +- 8 files changed, 55 insertions(+), 42 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php index 004cb8f57d..e8826f66a6 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php @@ -88,17 +88,17 @@ class TranslationExtensionTest extends TestCase // transchoice array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', - 'There is no apples', array('count' => 0),), + 'There is no apples', array('count' => 0)), array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', - 'There is 5 apples', array('count' => 5),), + 'There is 5 apples', array('count' => 5)), array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}', - 'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony'),), + 'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony')), array('{% transchoice count with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}', - 'There is 5 apples (Symfony)', array('count' => 5),), + 'There is 5 apples (Symfony)', array('count' => 5)), array('{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', - 'There is no apples', array('count' => 0),), + 'There is no apples', array('count' => 0)), array('{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', - 'There is 5 apples',), + 'There is 5 apples'), // trans filter array('{{ "Hello"|trans }}', 'Hello'), diff --git a/src/Symfony/Component/Finder/Tests/FinderTest.php b/src/Symfony/Component/Finder/Tests/FinderTest.php index cee8bd7530..aa2e706189 100644 --- a/src/Symfony/Component/Finder/Tests/FinderTest.php +++ b/src/Symfony/Component/Finder/Tests/FinderTest.php @@ -517,8 +517,7 @@ class FinderTest extends Iterator\RealIteratorTestCase $finder->in(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'r+e.gex[c]a(r)s') ->path('/^dir/'); - $expected = array('r+e.gex[c]a(r)s'.DIRECTORY_SEPARATOR.'dir', - 'r+e.gex[c]a(r)s'.DIRECTORY_SEPARATOR.'dir'.DIRECTORY_SEPARATOR.'bar.dat',); + $expected = array('r+e.gex[c]a(r)s'.DIRECTORY_SEPARATOR.'dir', 'r+e.gex[c]a(r)s'.DIRECTORY_SEPARATOR.'dir'.DIRECTORY_SEPARATOR.'bar.dat'); $this->assertIterator($this->toAbsoluteFixtures($expected), $finder); } diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php index 8d0e7a5c13..ca6ce8a386 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php @@ -43,8 +43,9 @@ class AttributeBagTest extends \PHPUnit_Framework_TestCase 'category' => array( 'fishing' => array( 'first' => 'cod', - 'second' => 'sole',), + 'second' => 'sole', ), + ), ); $this->bag = new AttributeBag('_sf2'); $this->bag->initialize($this->array); diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php index b8261da5d0..470038fe55 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php @@ -43,8 +43,9 @@ class NamespacedAttributeBagTest extends \PHPUnit_Framework_TestCase 'category' => array( 'fishing' => array( 'first' => 'cod', - 'second' => 'sole',), + 'second' => 'sole', ), + ), ); $this->bag = new NamespacedAttributeBag('_sf2', '/'); $this->bag->initialize($this->array); diff --git a/src/Symfony/Component/Routing/Tests/RouteCompilerTest.php b/src/Symfony/Component/Routing/Tests/RouteCompilerTest.php index 2b7c17faaa..f0a4aa4aed 100644 --- a/src/Symfony/Component/Routing/Tests/RouteCompilerTest.php +++ b/src/Symfony/Component/Routing/Tests/RouteCompilerTest.php @@ -38,7 +38,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase array('/foo'), '/foo', '#^/foo$#s', array(), array( array('text', '/foo'), - ),), + ), + ), array( 'Route with a variable', @@ -46,7 +47,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase '/foo', '#^/foo/(?P[^/]++)$#s', array('bar'), array( array('variable', '/', '[^/]++', 'bar'), array('text', '/foo'), - ),), + ), + ), array( 'Route with a variable that has a default value', @@ -54,7 +56,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase '/foo', '#^/foo(?:/(?P[^/]++))?$#s', array('bar'), array( array('variable', '/', '[^/]++', 'bar'), array('text', '/foo'), - ),), + ), + ), array( 'Route with several variables', @@ -63,7 +66,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase array('variable', '/', '[^/]++', 'foobar'), array('variable', '/', '[^/]++', 'bar'), array('text', '/foo'), - ),), + ), + ), array( 'Route with several variables that have default values', @@ -72,7 +76,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase array('variable', '/', '[^/]++', 'foobar'), array('variable', '/', '[^/]++', 'bar'), array('text', '/foo'), - ),), + ), + ), array( 'Route with several variables but some of them have no default values', @@ -81,28 +86,32 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase array('variable', '/', '[^/]++', 'foobar'), array('variable', '/', '[^/]++', 'bar'), array('text', '/foo'), - ),), + ), + ), array( 'Route with an optional variable as the first segment', array('/{bar}', array('bar' => 'bar')), '', '#^/(?P[^/]++)?$#s', array('bar'), array( array('variable', '/', '[^/]++', 'bar'), - ),), + ), + ), array( 'Route with a requirement of 0', array('/{bar}', array('bar' => null), array('bar' => '0')), '', '#^/(?P0)?$#s', array('bar'), array( array('variable', '/', '0', 'bar'), - ),), + ), + ), array( 'Route with an optional variable as the first segment with requirements', array('/{bar}', array('bar' => 'bar'), array('bar' => '(foo|bar)')), '', '#^/(?P(foo|bar))?$#s', array('bar'), array( array('variable', '/', '(foo|bar)', 'bar'), - ),), + ), + ), array( 'Route with only optional variables', @@ -110,44 +119,49 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase '', '#^/(?P[^/]++)?(?:/(?P[^/]++))?$#s', array('foo', 'bar'), array( array('variable', '/', '[^/]++', 'bar'), array('variable', '/', '[^/]++', 'foo'), - ),), + ), + ), array( 'Route with a variable in last position', array('/foo-{bar}'), '/foo', '#^/foo\-(?P[^/]++)$#s', array('bar'), array( - array('variable', '-', '[^/]++', 'bar'), - array('text', '/foo'), - ),), + array('variable', '-', '[^/]++', 'bar'), + array('text', '/foo'), + ), + ), array( 'Route with nested placeholders', array('/{static{var}static}'), '/{static', '#^/\{static(?P[^/]+)static\}$#s', array('var'), array( - array('text', 'static}'), - array('variable', '', '[^/]+', 'var'), - array('text', '/{static'), - ),), + array('text', 'static}'), + array('variable', '', '[^/]+', 'var'), + array('text', '/{static'), + ), + ), array( 'Route without separator between variables', array('/{w}{x}{y}{z}.{_format}', array('z' => 'default-z', '_format' => 'html'), array('y' => '(y|Y)')), '', '#^/(?P[^/\.]+)(?P[^/\.]+)(?P(y|Y))(?:(?P[^/\.]++)(?:\.(?P<_format>[^/]++))?)?$#s', array('w', 'x', 'y', 'z', '_format'), array( - array('variable', '.', '[^/]++', '_format'), - array('variable', '', '[^/\.]++', 'z'), - array('variable', '', '(y|Y)', 'y'), - array('variable', '', '[^/\.]+', 'x'), - array('variable', '/', '[^/\.]+', 'w'), - ),), + array('variable', '.', '[^/]++', '_format'), + array('variable', '', '[^/\.]++', 'z'), + array('variable', '', '(y|Y)', 'y'), + array('variable', '', '[^/\.]+', 'x'), + array('variable', '/', '[^/\.]+', 'w'), + ), + ), array( 'Route with a format', array('/foo/{bar}.{_format}'), '/foo', '#^/foo/(?P[^/\.]++)\.(?P<_format>[^/]++)$#s', array('bar', '_format'), array( - array('variable', '.', '[^/]++', '_format'), - array('variable', '/', '[^/\.]++', 'bar'), - array('text', '/foo'), - ),), + array('variable', '.', '[^/]++', '_format'), + array('variable', '/', '[^/\.]++', 'bar'), + array('text', '/foo'), + ), + ), ); } diff --git a/src/Symfony/Component/Serializer/Serializer.php b/src/Symfony/Component/Serializer/Serializer.php index 1819def5f6..c3e07e821c 100644 --- a/src/Symfony/Component/Serializer/Serializer.php +++ b/src/Symfony/Component/Serializer/Serializer.php @@ -237,7 +237,6 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz foreach ($this->normalizers as $normalizer) { if ($normalizer instanceof NormalizerInterface && $normalizer->supportsNormalization($object, $format)) { - return $normalizer->normalize($object, $format, $context); } } @@ -271,7 +270,6 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz foreach ($this->normalizers as $normalizer) { if ($normalizer instanceof DenormalizerInterface && $normalizer->supportsDenormalization($data, $class, $format)) { - return $normalizer->denormalize($data, $class, $format, $context); } } diff --git a/src/Symfony/Component/Translation/Tests/fixtures/resources.php b/src/Symfony/Component/Translation/Tests/fixtures/resources.php index c291398539..0cc2bec1d5 100644 --- a/src/Symfony/Component/Translation/Tests/fixtures/resources.php +++ b/src/Symfony/Component/Translation/Tests/fixtures/resources.php @@ -1,5 +1,5 @@ 'bar', ); diff --git a/src/Symfony/Component/Yaml/Escaper.php b/src/Symfony/Component/Yaml/Escaper.php index ac325a2c2f..cb676d0059 100644 --- a/src/Symfony/Component/Yaml/Escaper.php +++ b/src/Symfony/Component/Yaml/Escaper.php @@ -31,13 +31,13 @@ class Escaper "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", - "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",); + "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9"); private static $escaped = array('\\\\', '\\"', '\\\\', '\\"', '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', - '\\N', '\\_', '\\L', '\\P',); + '\\N', '\\_', '\\L', '\\P'); /** * Determines if a PHP value would require double quoting in YAML.