Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8f95b5

Browse files
committed
merged branch Tobion/deprecated-form-exception (PR #7927)
This PR was merged into the master branch. Discussion ---------- [Form] removed deprecated exceptions Removed deprecated exceptions for 2.3. | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 82ff360 [Form] removed deprecated exceptions
2 parents 1df7876 + 82ff360 commit c8f95b5

File tree

7 files changed

+8
-61
lines changed

7 files changed

+8
-61
lines changed

src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Form\ChoiceList;
1313

14-
use Symfony\Component\Form\Exception\Exception;
14+
use Symfony\Component\Form\Exception\RuntimeException;
1515
use Symfony\Component\Form\Exception\StringCastException;
1616
use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList;
1717
use Doctrine\Common\Persistence\ObjectManager;
@@ -406,12 +406,12 @@ private function load()
406406
*
407407
* @return array The identifier values
408408
*
409-
* @throws Exception If the entity does not exist in Doctrine's identity map
409+
* @throws RuntimeException If the entity does not exist in Doctrine's identity map
410410
*/
411411
private function getIdentifierValues($entity)
412412
{
413413
if (!$this->em->contains($entity)) {
414-
throw new Exception(
414+
throw new RuntimeException(
415415
'Entities passed to the choice field must be managed. Maybe ' .
416416
'persist them in the entity manager?'
417417
);

src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Bridge\Doctrine\Form\Type;
1313

1414
use Doctrine\Common\Persistence\ManagerRegistry;
15-
use Symfony\Component\Form\Exception\Exception;
15+
use Symfony\Component\Form\Exception\RuntimeException;
1616
use Doctrine\Common\Persistence\ObjectManager;
1717
use Symfony\Component\Form\FormBuilderInterface;
1818
use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList;
@@ -144,7 +144,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
144144
$em = $registry->getManagerForClass($options['class']);
145145

146146
if (null === $em) {
147-
throw new Exception(sprintf(
147+
throw new RuntimeException(sprintf(
148148
'Class "%s" seems not to be a managed Doctrine entity. ' .
149149
'Did you forget to map it?',
150150
$options['class']

src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected function tearDown()
7070
}
7171

7272
/**
73-
* @expectedException \Symfony\Component\Form\Exception\FormException
73+
* @expectedException \Symfony\Component\Form\Exception\StringCastException
7474
* @expectedMessage Entity "Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity" passed to the choice field must have a "__toString()" method defined (or you can also override the "property" option).
7575
*/
7676
public function testEntitiesMustHaveAToStringMethod()
@@ -97,7 +97,7 @@ public function testEntitiesMustHaveAToStringMethod()
9797
}
9898

9999
/**
100-
* @expectedException \Symfony\Component\Form\Exception\FormException
100+
* @expectedException \Symfony\Component\Form\Exception\RuntimeException
101101
*/
102102
public function testChoicesMustBeManaged()
103103
{

src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use \BaseObject;
1616
use \Persistent;
1717

18-
use Symfony\Component\Form\Exception\FormException;
1918
use Symfony\Component\Form\Exception\StringCastException;
2019
use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList;
2120
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
@@ -379,8 +378,6 @@ private function load()
379378
* @param object $model The model for which to get the identifier
380379
*
381380
* @return array
382-
*
383-
* @throws FormException If the model does not exist
384381
*/
385382
private function getIdentifierValues($model)
386383
{

src/Symfony/Component/Form/Exception/Exception.php

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/Symfony/Component/Form/Exception/ExceptionInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
*
1717
* @author Bernhard Schussek <[email protected]>
1818
*/
19-
interface ExceptionInterface extends FormException
19+
interface ExceptionInterface
2020
{
2121
}

src/Symfony/Component/Form/Exception/FormException.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)