diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/routing.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/routing.yml index c119432a48..8a9bd84b14 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/routing.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/routing.yml @@ -1,2 +1,2 @@ _fragmenttest_bundle: - resource: @TestBundle/Resources/config/routing.yml + resource: '@TestBundle/Resources/config/routing.yml' diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Profiler/routing.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Profiler/routing.yml index 508a6b2f5c..d4b77c3f70 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Profiler/routing.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Profiler/routing.yml @@ -1,2 +1,2 @@ _sessiontest_bundle: - resource: @TestBundle/Resources/config/routing.yml + resource: '@TestBundle/Resources/config/routing.yml' diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/routing.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/routing.yml index 508a6b2f5c..d4b77c3f70 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/routing.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/routing.yml @@ -1,2 +1,2 @@ _sessiontest_bundle: - resource: @TestBundle/Resources/config/routing.yml + resource: '@TestBundle/Resources/config/routing.yml' diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/config.yml b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/config.yml index d7ad6049aa..ffcc9352d8 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/config.yml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/config.yml @@ -5,7 +5,7 @@ services: csrf_form_login.form.type: class: Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\CsrfFormLoginBundle\Form\UserLoginType arguments: - - @request_stack + - '@request_stack' tags: - { name: form.type } diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/routing.yml b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/routing.yml index e2e84d9fe5..ecfae00918 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/routing.yml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/routing.yml @@ -1,2 +1,2 @@ _csrf_form_login_bundle: - resource: @CsrfFormLoginBundle/Resources/config/routing.yml + resource: '@CsrfFormLoginBundle/Resources/config/routing.yml' diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/routing.yml b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/routing.yml index 6c408c150d..0920ea1d70 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/routing.yml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/routing.yml @@ -1,5 +1,5 @@ _form_login_bundle: - resource: @FormLoginBundle/Resources/config/routing.yml + resource: '@FormLoginBundle/Resources/config/routing.yml' _form_login_localized: - resource: @FormLoginBundle/Resources/config/localized_routing.yml + resource: '@FormLoginBundle/Resources/config/localized_routing.yml' diff --git a/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php index 6eb86c0fab..14f7bbe81a 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php @@ -173,10 +173,10 @@ class YamlDumper extends Dumper private function addServiceAlias($alias, $id) { if ($id->isPublic()) { - return sprintf(" %s: @%s\n", $alias, $id); - } else { - return sprintf(" %s:\n alias: %s\n public: false", $alias, $id); + return sprintf(" %s: '@%s'\n", $alias, $id); } + + return sprintf(" %s:\n alias: %s\n public: false", $alias, $id); } /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml index 3c127466af..b62d5ccfb5 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml @@ -6,7 +6,7 @@ parameters: - 0 - 1000.3 bar: foo - escape: @@escapeme - foo_bar: @foo_bar + escape: '@@escapeme' + foo_bar: '@foo_bar' MixedCase: MixedCaseKey: value diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml index 6a377c91d3..3658fac94d 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml @@ -3,7 +3,7 @@ services: baz: { class: BazClass } not_shared: { class: FooClass, shared: false } file: { class: FooClass, file: %path%/foo.php } - arguments: { class: FooClass, arguments: [foo, @foo, [true, false]] } + arguments: { class: FooClass, arguments: [foo, '@foo', [true, false]] } configurator1: { class: FooClass, configurator: sc_configure } configurator2: { class: FooClass, configurator: [@baz, configure] } configurator3: { class: FooClass, configurator: [BazClass, configureStatic] } @@ -16,8 +16,8 @@ services: method_call2: class: FooClass calls: - - [ setBar, [ foo, @foo, [true, false] ] ] - alias_for_foo: @foo + - [ setBar, [ foo, '@foo', [true, false] ] ] + alias_for_foo: '@foo' another_alias_for_foo: alias: foo public: false diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml index 0525b3068c..37f7e19516 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml @@ -93,5 +93,5 @@ services: service_from_static_method: class: Bar\FooClass factory: [Bar\FooClass, getInstance] - alias_for_foo: @foo - alias_for_alias: @foo + alias_for_foo: '@foo' + alias_for_alias: '@foo' diff --git a/src/Symfony/Component/Form/FormRegistry.php b/src/Symfony/Component/Form/FormRegistry.php index e9809edcdc..66d5a1f7c2 100644 --- a/src/Symfony/Component/Form/FormRegistry.php +++ b/src/Symfony/Component/Form/FormRegistry.php @@ -74,10 +74,6 @@ class FormRegistry implements FormRegistryInterface */ public function getType($name) { - if (!is_string($name)) { - throw new UnexpectedTypeException($name, 'string'); - } - if (!isset($this->types[$name])) { $type = null; diff --git a/src/Symfony/Component/Form/FormRegistryInterface.php b/src/Symfony/Component/Form/FormRegistryInterface.php index b42b2b5818..f16c0cb8fb 100644 --- a/src/Symfony/Component/Form/FormRegistryInterface.php +++ b/src/Symfony/Component/Form/FormRegistryInterface.php @@ -27,7 +27,6 @@ interface FormRegistryInterface * * @return ResolvedFormTypeInterface The type * - * @throws Exception\UnexpectedTypeException if the passed name is not a string * @throws Exception\InvalidArgumentException if the type can not be retrieved from any extension */ public function getType($name); diff --git a/src/Symfony/Component/Form/Tests/FormRegistryTest.php b/src/Symfony/Component/Form/Tests/FormRegistryTest.php index 849f49476a..cabb19b2d6 100644 --- a/src/Symfony/Component/Form/Tests/FormRegistryTest.php +++ b/src/Symfony/Component/Form/Tests/FormRegistryTest.php @@ -277,14 +277,6 @@ class FormRegistryTest extends \PHPUnit_Framework_TestCase $this->registry->getType('bar'); } - /** - * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException - */ - public function testGetTypeThrowsExceptionIfNoString() - { - $this->registry->getType(array()); - } - public function testHasTypeAfterLoadingFromExtension() { $type = new FooType(); diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php b/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php index f91df98476..e7dea88ed3 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php @@ -15,6 +15,8 @@ namespace Symfony\Component\Routing\Matcher\Dumper; * Collection of routes. * * @author Arnaud Le Blanc + * + * @internal */ class DumperCollection implements \IteratorAggregate { diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php b/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php index 6a615f21ad..dd1a0d90e1 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php @@ -15,6 +15,8 @@ namespace Symfony\Component\Routing\Matcher\Dumper; * Prefix tree of routes preserving routes order. * * @author Arnaud Le Blanc + * + * @internal */ class DumperPrefixCollection extends DumperCollection { diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php b/src/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php index 2928cdcc0b..3ad08c2006 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php @@ -17,6 +17,8 @@ use Symfony\Component\Routing\Route; * Container for a Route. * * @author Arnaud Le Blanc + * + * @internal */ class DumperRoute { diff --git a/src/Symfony/Component/Translation/Loader/CsvFileLoader.php b/src/Symfony/Component/Translation/Loader/CsvFileLoader.php index cfba59e767..f1d3443f4c 100644 --- a/src/Symfony/Component/Translation/Loader/CsvFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/CsvFileLoader.php @@ -41,18 +41,8 @@ class CsvFileLoader extends FileLoader $file->setCsvControl($this->delimiter, $this->enclosure, $this->escape); foreach ($file as $data) { - if (substr($data[0], 0, 1) === '#') { - continue; - } - - if (!isset($data[1])) { - continue; - } - - if (count($data) == 2) { + if ('#' !== substr($data[0], 0, 1) && isset($data[1]) && 2 === count($data)) { $messages[$data[0]] = $data[1]; - } else { - continue; } } diff --git a/src/Symfony/Component/VarDumper/Caster/Caster.php b/src/Symfony/Component/VarDumper/Caster/Caster.php index 6345ad7fde..23e72e8770 100644 --- a/src/Symfony/Component/VarDumper/Caster/Caster.php +++ b/src/Symfony/Component/VarDumper/Caster/Caster.php @@ -55,7 +55,7 @@ class Caster if (!isset($k[0]) || ("\0" !== $k[0] && !$reflector->hasProperty($k))) { $p[$i] = self::PREFIX_DYNAMIC.$k; } elseif (isset($k[16]) && "\0" === $k[16] && 0 === strpos($k, "\0class@anonymous\0")) { - $p[$i] = "\0anonymous-".$reflector->name.strrchr($k, "\0"); + $p[$i] = "\0".$reflector->getParentClass().'@anonymous'.strrchr($k, "\0"); } } $a = array_combine($p, $a); diff --git a/src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php b/src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php index 08bf7d33b3..a63af92acd 100644 --- a/src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php +++ b/src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php @@ -224,14 +224,12 @@ abstract class AbstractCloner implements ClonerInterface $class = $stub->class; if (isset($class[15]) && "\0" === $class[15] && 0 === strpos($class, "class@anonymous\x00")) { - $class = get_parent_class($class); - $stub->class = 'anonymous-'.$class; + $stub->class = get_parent_class($class).'@anonymous'; } if (isset($this->classInfo[$class])) { $classInfo = $this->classInfo[$class]; } else { $classInfo = array( - $class, new \ReflectionClass($class), array_reverse(array($class => $class) + class_parents($class) + class_implements($class) + array('*' => '*')), ); @@ -239,9 +237,9 @@ abstract class AbstractCloner implements ClonerInterface $this->classInfo[$class] = $classInfo; } - $a = $this->callCaster('Symfony\Component\VarDumper\Caster\Caster::castObject', $obj, $classInfo[1], null, $isNested); + $a = $this->callCaster('Symfony\Component\VarDumper\Caster\Caster::castObject', $obj, $classInfo[0], null, $isNested); - foreach ($classInfo[2] as $p) { + foreach ($classInfo[1] as $p) { if (!empty($this->casters[$p = strtolower($p)])) { foreach ($this->casters[$p] as $p) { $a = $this->callCaster($p, $obj, $a, $stub, $isNested); diff --git a/src/Symfony/Component/VarDumper/Tests/Caster/CasterTest.php b/src/Symfony/Component/VarDumper/Tests/Caster/CasterTest.php index 1f30f2aa34..2c42a90660 100644 --- a/src/Symfony/Component/VarDumper/Tests/Caster/CasterTest.php +++ b/src/Symfony/Component/VarDumper/Tests/Caster/CasterTest.php @@ -157,7 +157,18 @@ class CasterTest extends VarDumperTestCase $this->assertDumpMatchesFormat( <<<'EOTXT' -anonymous-stdClass { +stdClass@anonymous { + -foo: "foo" +} +EOTXT + , $c + ); + + $c = eval('return new class { private $foo = "foo"; };'); + + $this->assertDumpMatchesFormat( + <<<'EOTXT' +@anonymous { -foo: "foo" } EOTXT