Skip to content

Commit

Permalink
minor #24504 [Form] Fix error message in circular reference dependenc…
Browse files Browse the repository at this point in the history
…ies check (pierredup)

This PR was squashed before being merged into the 3.4 branch (closes #24504).

Discussion
----------

[Form] Fix error message in circular reference dependencies check

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

Fix comments from PR #24387

Commits
-------

48eb43d [Form] Fix error message in circular reference dependencies check
  • Loading branch information
stof committed Oct 10, 2017
2 parents d3bc436 + 48eb43d commit c3524d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/FormRegistry.php
Expand Up @@ -111,7 +111,7 @@ private function resolveType(FormTypeInterface $type)

if (isset($this->checkedTypes[$fqcn])) {
$types = implode(' > ', array_merge(array_keys($this->checkedTypes), array($fqcn)));
throw new LogicException(sprintf('Circular reference detected for form "%s" (%s).', $fqcn, $types));
throw new LogicException(sprintf('Circular reference detected for form type "%s" (%s).', $fqcn, $types));
}

$this->checkedTypes[$fqcn] = true;
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Form/Tests/FormRegistryTest.php
Expand Up @@ -162,7 +162,7 @@ public function testGetTypeConnectsParent()

/**
* @expectedException \Symfony\Component\Form\Exception\LogicException
* @expectedExceptionMessage Circular reference detected for form "Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType" (Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType > Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType).
* @expectedExceptionMessage Circular reference detected for form type "Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType" (Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType > Symfony\Component\Form\Tests\Fixtures\FormWithSameParentType).
*/
public function testFormCannotHaveItselfAsAParent()
{
Expand All @@ -175,7 +175,7 @@ public function testFormCannotHaveItselfAsAParent()

/**
* @expectedException \Symfony\Component\Form\Exception\LogicException
* @expectedExceptionMessage Circular reference detected for form "Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo" (Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeBar > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeBaz > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo).
* @expectedExceptionMessage Circular reference detected for form type "Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo" (Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeBar > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeBaz > Symfony\Component\Form\Tests\Fixtures\RecursiveFormTypeFoo).
*/
public function testRecursiveFormDependencies()
{
Expand Down

0 comments on commit c3524d0

Please sign in to comment.