From 9d698e7225ab5d3bca8148b02822818cfaccb7ab Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 24 Aug 2015 08:21:47 +0200 Subject: [PATCH 1/2] [Form] made deprecation notice more precise --- src/Symfony/Component/Form/FormRegistry.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Form/FormRegistry.php b/src/Symfony/Component/Form/FormRegistry.php index dbf944e5cb..e9809edcdc 100644 --- a/src/Symfony/Component/Form/FormRegistry.php +++ b/src/Symfony/Component/Form/FormRegistry.php @@ -101,7 +101,7 @@ class FormRegistry implements FormRegistryInterface } if (isset($this->legacyNames[$name])) { - @trigger_error('Accessing types by their string name is deprecated since version 2.8 and will be removed in 3.0. Use the fully-qualified type class name instead.', E_USER_DEPRECATED); + @trigger_error(sprintf('Accessing type "%s" by its string name is deprecated since version 2.8 and will be removed in 3.0. Use the fully-qualified type class name "%s" instead.', $name, get_class($this->types[$name]->getInnerType())), E_USER_DEPRECATED); } return $this->types[$name]; @@ -171,7 +171,7 @@ class FormRegistry implements FormRegistryInterface public function hasType($name) { if (isset($this->legacyNames[$name])) { - @trigger_error('Accessing types by their string name is deprecated since version 2.8 and will be removed in 3.0. Use the fully-qualified type class name instead.', E_USER_DEPRECATED); + @trigger_error(sprintf('Accessing type "%s" by its string name is deprecated since version 2.8 and will be removed in 3.0. Use the fully-qualified type class name "%s" instead.', $name, get_class($this->types[$name]->getInnerType())), E_USER_DEPRECATED); } if (isset($this->types[$name])) { From 19f4ada7d786ab1dd3ae6d906fa06f8133c76f30 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 24 Aug 2015 08:21:59 +0200 Subject: [PATCH 2/2] fixed tests using deprecation features --- .../Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php index 7ebcb40aed..f9e7b6760a 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php @@ -346,7 +346,7 @@ class EntityTypeTest extends TypeTestCase $this->persist(array($innerEntity1, $innerEntity2, $entity1, $entity2)); - $field = $this->factory->createNamed('name', 'entity', null, array( + $field = $this->factory->createNamed('name', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array( 'multiple' => false, 'expanded' => false, 'em' => 'default', @@ -421,7 +421,7 @@ class EntityTypeTest extends TypeTestCase $this->persist(array($innerEntity1, $innerEntity2, $innerEntity3, $entity1, $entity2, $entity3)); - $field = $this->factory->createNamed('name', 'entity', null, array( + $field = $this->factory->createNamed('name', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array( 'multiple' => true, 'expanded' => false, 'em' => 'default', @@ -732,7 +732,7 @@ class EntityTypeTest extends TypeTestCase $this->persist(array($innerEntity1, $innerEntity2, $entity1, $entity2)); - $field = $this->factory->createNamed('name', 'entity', null, array( + $field = $this->factory->createNamed('name', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array( 'em' => 'default', 'class' => self::SINGLE_ASSOC_IDENT_CLASS, 'choices' => array($entity1, $entity2), @@ -804,7 +804,7 @@ class EntityTypeTest extends TypeTestCase $repository = $this->em->getRepository(self::SINGLE_ASSOC_IDENT_CLASS); - $field = $this->factory->createNamed('name', 'entity', null, array( + $field = $this->factory->createNamed('name', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array( 'em' => 'default', 'class' => self::SINGLE_ASSOC_IDENT_CLASS, 'query_builder' => $repository->createQueryBuilder('e')