minor #15596 Deprecation notices fixes (fabpot)

This PR was merged into the 2.8 branch.

Discussion
----------

Deprecation notices fixes

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

19f4ada fixed tests using deprecation features
9d698e7 [Form] made deprecation notice more precise
This commit is contained in:
Fabien Potencier 2015-08-24 10:59:28 +02:00
commit e7772723bd
2 changed files with 6 additions and 6 deletions

View File

@ -346,7 +346,7 @@ class EntityTypeTest extends TypeTestCase
$this->persist(array($innerEntity1, $innerEntity2, $entity1, $entity2)); $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, 'multiple' => false,
'expanded' => false, 'expanded' => false,
'em' => 'default', 'em' => 'default',
@ -421,7 +421,7 @@ class EntityTypeTest extends TypeTestCase
$this->persist(array($innerEntity1, $innerEntity2, $innerEntity3, $entity1, $entity2, $entity3)); $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, 'multiple' => true,
'expanded' => false, 'expanded' => false,
'em' => 'default', 'em' => 'default',
@ -732,7 +732,7 @@ class EntityTypeTest extends TypeTestCase
$this->persist(array($innerEntity1, $innerEntity2, $entity1, $entity2)); $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', 'em' => 'default',
'class' => self::SINGLE_ASSOC_IDENT_CLASS, 'class' => self::SINGLE_ASSOC_IDENT_CLASS,
'choices' => array($entity1, $entity2), 'choices' => array($entity1, $entity2),
@ -804,7 +804,7 @@ class EntityTypeTest extends TypeTestCase
$repository = $this->em->getRepository(self::SINGLE_ASSOC_IDENT_CLASS); $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', 'em' => 'default',
'class' => self::SINGLE_ASSOC_IDENT_CLASS, 'class' => self::SINGLE_ASSOC_IDENT_CLASS,
'query_builder' => $repository->createQueryBuilder('e') 'query_builder' => $repository->createQueryBuilder('e')

View File

@ -101,7 +101,7 @@ class FormRegistry implements FormRegistryInterface
} }
if (isset($this->legacyNames[$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);
} }
return $this->types[$name]; return $this->types[$name];
@ -171,7 +171,7 @@ class FormRegistry implements FormRegistryInterface
public function hasType($name) public function hasType($name)
{ {
if (isset($this->legacyNames[$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])) { if (isset($this->types[$name])) {