fixed CS
This commit is contained in:
parent
6d8078febf
commit
42862c4668
@ -88,17 +88,17 @@ class TranslationExtensionTest extends TestCase
|
|||||||
|
|
||||||
// transchoice
|
// transchoice
|
||||||
array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
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 %}',
|
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 %}',
|
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 %}',
|
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 %}',
|
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 %}',
|
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
|
// trans filter
|
||||||
array('{{ "Hello"|trans }}', 'Hello'),
|
array('{{ "Hello"|trans }}', 'Hello'),
|
||||||
|
@ -517,8 +517,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
|
|||||||
$finder->in(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'r+e.gex[c]a(r)s')
|
$finder->in(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'r+e.gex[c]a(r)s')
|
||||||
->path('/^dir/');
|
->path('/^dir/');
|
||||||
|
|
||||||
$expected = array('r+e.gex[c]a(r)s'.DIRECTORY_SEPARATOR.'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');
|
||||||
'r+e.gex[c]a(r)s'.DIRECTORY_SEPARATOR.'dir'.DIRECTORY_SEPARATOR.'bar.dat',);
|
|
||||||
$this->assertIterator($this->toAbsoluteFixtures($expected), $finder);
|
$this->assertIterator($this->toAbsoluteFixtures($expected), $finder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,8 @@ class AttributeBagTest extends \PHPUnit_Framework_TestCase
|
|||||||
'category' => array(
|
'category' => array(
|
||||||
'fishing' => array(
|
'fishing' => array(
|
||||||
'first' => 'cod',
|
'first' => 'cod',
|
||||||
'second' => 'sole',),
|
'second' => 'sole',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
$this->bag = new AttributeBag('_sf2');
|
$this->bag = new AttributeBag('_sf2');
|
||||||
|
@ -43,7 +43,8 @@ class NamespacedAttributeBagTest extends \PHPUnit_Framework_TestCase
|
|||||||
'category' => array(
|
'category' => array(
|
||||||
'fishing' => array(
|
'fishing' => array(
|
||||||
'first' => 'cod',
|
'first' => 'cod',
|
||||||
'second' => 'sole',),
|
'second' => 'sole',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
$this->bag = new NamespacedAttributeBag('_sf2', '/');
|
$this->bag = new NamespacedAttributeBag('_sf2', '/');
|
||||||
|
@ -38,7 +38,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('/foo'),
|
array('/foo'),
|
||||||
'/foo', '#^/foo$#s', array(), array(
|
'/foo', '#^/foo$#s', array(), array(
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with a variable',
|
'Route with a variable',
|
||||||
@ -46,7 +47,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
'/foo', '#^/foo/(?P<bar>[^/]++)$#s', array('bar'), array(
|
'/foo', '#^/foo/(?P<bar>[^/]++)$#s', array('bar'), array(
|
||||||
array('variable', '/', '[^/]++', 'bar'),
|
array('variable', '/', '[^/]++', 'bar'),
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with a variable that has a default value',
|
'Route with a variable that has a default value',
|
||||||
@ -54,7 +56,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
'/foo', '#^/foo(?:/(?P<bar>[^/]++))?$#s', array('bar'), array(
|
'/foo', '#^/foo(?:/(?P<bar>[^/]++))?$#s', array('bar'), array(
|
||||||
array('variable', '/', '[^/]++', 'bar'),
|
array('variable', '/', '[^/]++', 'bar'),
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with several variables',
|
'Route with several variables',
|
||||||
@ -63,7 +66,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('variable', '/', '[^/]++', 'foobar'),
|
array('variable', '/', '[^/]++', 'foobar'),
|
||||||
array('variable', '/', '[^/]++', 'bar'),
|
array('variable', '/', '[^/]++', 'bar'),
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with several variables that have default values',
|
'Route with several variables that have default values',
|
||||||
@ -72,7 +76,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('variable', '/', '[^/]++', 'foobar'),
|
array('variable', '/', '[^/]++', 'foobar'),
|
||||||
array('variable', '/', '[^/]++', 'bar'),
|
array('variable', '/', '[^/]++', 'bar'),
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with several variables but some of them have no default values',
|
'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', '/', '[^/]++', 'foobar'),
|
||||||
array('variable', '/', '[^/]++', 'bar'),
|
array('variable', '/', '[^/]++', 'bar'),
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with an optional variable as the first segment',
|
'Route with an optional variable as the first segment',
|
||||||
array('/{bar}', array('bar' => 'bar')),
|
array('/{bar}', array('bar' => 'bar')),
|
||||||
'', '#^/(?P<bar>[^/]++)?$#s', array('bar'), array(
|
'', '#^/(?P<bar>[^/]++)?$#s', array('bar'), array(
|
||||||
array('variable', '/', '[^/]++', 'bar'),
|
array('variable', '/', '[^/]++', 'bar'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with a requirement of 0',
|
'Route with a requirement of 0',
|
||||||
array('/{bar}', array('bar' => null), array('bar' => '0')),
|
array('/{bar}', array('bar' => null), array('bar' => '0')),
|
||||||
'', '#^/(?P<bar>0)?$#s', array('bar'), array(
|
'', '#^/(?P<bar>0)?$#s', array('bar'), array(
|
||||||
array('variable', '/', '0', 'bar'),
|
array('variable', '/', '0', 'bar'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with an optional variable as the first segment with requirements',
|
'Route with an optional variable as the first segment with requirements',
|
||||||
array('/{bar}', array('bar' => 'bar'), array('bar' => '(foo|bar)')),
|
array('/{bar}', array('bar' => 'bar'), array('bar' => '(foo|bar)')),
|
||||||
'', '#^/(?P<bar>(foo|bar))?$#s', array('bar'), array(
|
'', '#^/(?P<bar>(foo|bar))?$#s', array('bar'), array(
|
||||||
array('variable', '/', '(foo|bar)', 'bar'),
|
array('variable', '/', '(foo|bar)', 'bar'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with only optional variables',
|
'Route with only optional variables',
|
||||||
@ -110,7 +119,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
'', '#^/(?P<foo>[^/]++)?(?:/(?P<bar>[^/]++))?$#s', array('foo', 'bar'), array(
|
'', '#^/(?P<foo>[^/]++)?(?:/(?P<bar>[^/]++))?$#s', array('foo', 'bar'), array(
|
||||||
array('variable', '/', '[^/]++', 'bar'),
|
array('variable', '/', '[^/]++', 'bar'),
|
||||||
array('variable', '/', '[^/]++', 'foo'),
|
array('variable', '/', '[^/]++', 'foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with a variable in last position',
|
'Route with a variable in last position',
|
||||||
@ -118,7 +128,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
'/foo', '#^/foo\-(?P<bar>[^/]++)$#s', array('bar'), array(
|
'/foo', '#^/foo\-(?P<bar>[^/]++)$#s', array('bar'), array(
|
||||||
array('variable', '-', '[^/]++', 'bar'),
|
array('variable', '-', '[^/]++', 'bar'),
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with nested placeholders',
|
'Route with nested placeholders',
|
||||||
@ -127,7 +138,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('text', 'static}'),
|
array('text', 'static}'),
|
||||||
array('variable', '', '[^/]+', 'var'),
|
array('variable', '', '[^/]+', 'var'),
|
||||||
array('text', '/{static'),
|
array('text', '/{static'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route without separator between variables',
|
'Route without separator between variables',
|
||||||
@ -138,7 +150,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('variable', '', '(y|Y)', 'y'),
|
array('variable', '', '(y|Y)', 'y'),
|
||||||
array('variable', '', '[^/\.]+', 'x'),
|
array('variable', '', '[^/\.]+', 'x'),
|
||||||
array('variable', '/', '[^/\.]+', 'w'),
|
array('variable', '/', '[^/\.]+', 'w'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'Route with a format',
|
'Route with a format',
|
||||||
@ -147,7 +160,8 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('variable', '.', '[^/]++', '_format'),
|
array('variable', '.', '[^/]++', '_format'),
|
||||||
array('variable', '/', '[^/\.]++', 'bar'),
|
array('variable', '/', '[^/\.]++', 'bar'),
|
||||||
array('text', '/foo'),
|
array('text', '/foo'),
|
||||||
),),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +237,6 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz
|
|||||||
foreach ($this->normalizers as $normalizer) {
|
foreach ($this->normalizers as $normalizer) {
|
||||||
if ($normalizer instanceof NormalizerInterface
|
if ($normalizer instanceof NormalizerInterface
|
||||||
&& $normalizer->supportsNormalization($object, $format)) {
|
&& $normalizer->supportsNormalization($object, $format)) {
|
||||||
|
|
||||||
return $normalizer->normalize($object, $format, $context);
|
return $normalizer->normalize($object, $format, $context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -271,7 +270,6 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz
|
|||||||
foreach ($this->normalizers as $normalizer) {
|
foreach ($this->normalizers as $normalizer) {
|
||||||
if ($normalizer instanceof DenormalizerInterface
|
if ($normalizer instanceof DenormalizerInterface
|
||||||
&& $normalizer->supportsDenormalization($data, $class, $format)) {
|
&& $normalizer->supportsDenormalization($data, $class, $format)) {
|
||||||
|
|
||||||
return $normalizer->denormalize($data, $class, $format, $context);
|
return $normalizer->denormalize($data, $class, $format, $context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return array (
|
return array(
|
||||||
'foo' => 'bar',
|
'foo' => 'bar',
|
||||||
);
|
);
|
||||||
|
@ -31,13 +31,13 @@ class Escaper
|
|||||||
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
|
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
|
||||||
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
|
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
|
||||||
"\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f",
|
"\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('\\\\', '\\"', '\\\\', '\\"',
|
private static $escaped = array('\\\\', '\\"', '\\\\', '\\"',
|
||||||
'\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a',
|
'\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a',
|
||||||
'\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f',
|
'\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f',
|
||||||
'\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',
|
'\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',
|
||||||
'\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f',
|
'\\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.
|
* Determines if a PHP value would require double quoting in YAML.
|
||||||
|
Reference in New Issue
Block a user