diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php index fabd25f7c2..74042a7b41 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php @@ -11,7 +11,7 @@ namespace Symfony\Bridge\Doctrine\Form\ChoiceList; -use Symfony\Component\Form\Exception\Exception; +use Symfony\Component\Form\Exception\RuntimeException; use Symfony\Component\Form\Exception\StringCastException; use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList; use Doctrine\Common\Persistence\ObjectManager; @@ -406,12 +406,12 @@ class EntityChoiceList extends ObjectChoiceList * * @return array The identifier values * - * @throws Exception If the entity does not exist in Doctrine's identity map + * @throws RuntimeException If the entity does not exist in Doctrine's identity map */ private function getIdentifierValues($entity) { if (!$this->em->contains($entity)) { - throw new Exception( + throw new RuntimeException( 'Entities passed to the choice field must be managed. Maybe ' . 'persist them in the entity manager?' ); diff --git a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php index df6f2077f8..81623966c1 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php @@ -12,7 +12,7 @@ namespace Symfony\Bridge\Doctrine\Form\Type; use Doctrine\Common\Persistence\ManagerRegistry; -use Symfony\Component\Form\Exception\Exception; +use Symfony\Component\Form\Exception\RuntimeException; use Doctrine\Common\Persistence\ObjectManager; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList; @@ -144,7 +144,7 @@ abstract class DoctrineType extends AbstractType $em = $registry->getManagerForClass($options['class']); if (null === $em) { - throw new Exception(sprintf( + throw new RuntimeException(sprintf( 'Class "%s" seems not to be a managed Doctrine entity. ' . 'Did you forget to map it?', $options['class'] diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php index a3ce750343..cce4578798 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php @@ -70,7 +70,7 @@ class EntityChoiceListTest extends DoctrineOrmTestCase } /** - * @expectedException \Symfony\Component\Form\Exception\FormException + * @expectedException \Symfony\Component\Form\Exception\StringCastException * @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). */ public function testEntitiesMustHaveAToStringMethod() @@ -97,7 +97,7 @@ class EntityChoiceListTest extends DoctrineOrmTestCase } /** - * @expectedException \Symfony\Component\Form\Exception\FormException + * @expectedException \Symfony\Component\Form\Exception\RuntimeException */ public function testChoicesMustBeManaged() { diff --git a/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php b/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php index b2d9b52cad..589c0235f5 100644 --- a/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php +++ b/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php @@ -15,7 +15,6 @@ use \ModelCriteria; use \BaseObject; use \Persistent; -use Symfony\Component\Form\Exception\FormException; use Symfony\Component\Form\Exception\StringCastException; use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList; use Symfony\Component\PropertyAccess\PropertyAccessorInterface; @@ -379,8 +378,6 @@ class ModelChoiceList extends ObjectChoiceList * @param object $model The model for which to get the identifier * * @return array - * - * @throws FormException If the model does not exist */ private function getIdentifierValues($model) { diff --git a/src/Symfony/Component/Form/Exception/Exception.php b/src/Symfony/Component/Form/Exception/Exception.php deleted file mode 100644 index b882d70396..0000000000 --- a/src/Symfony/Component/Form/Exception/Exception.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form\Exception; - -/** - * Base exception class. - * - * @author Bernhard Schussek - * - * @deprecated This class is a replacement for when class FormException was - * used previously. It should not be used and will be removed. - * Occurrences of this class should be replaced by more specialized - * exception classes, preferably derived from SPL exceptions. - */ -class Exception extends \Exception implements ExceptionInterface -{ -} diff --git a/src/Symfony/Component/Form/Exception/ExceptionInterface.php b/src/Symfony/Component/Form/Exception/ExceptionInterface.php index 975bdb89ad..d455932edf 100644 --- a/src/Symfony/Component/Form/Exception/ExceptionInterface.php +++ b/src/Symfony/Component/Form/Exception/ExceptionInterface.php @@ -16,6 +16,6 @@ namespace Symfony\Component\Form\Exception; * * @author Bernhard Schussek */ -interface ExceptionInterface extends FormException +interface ExceptionInterface { } diff --git a/src/Symfony/Component/Form/Exception/FormException.php b/src/Symfony/Component/Form/Exception/FormException.php deleted file mode 100644 index dbc6d06499..0000000000 --- a/src/Symfony/Component/Form/Exception/FormException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form\Exception; - -/** - * Alias of {@link ExceptionInterface}. - * - * @author Bernhard Schussek - * - * @deprecated This interface was deprecated and will be removed in Symfony 2.3. - * You should code against {@link ExceptionInterface} instead. - */ -interface FormException -{ -}