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

Skip to content

[Form] removed deprecated exceptions #7927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -406,12 +406,12 @@ private function load()
*
* @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?'
);
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -144,7 +144,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
$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']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function tearDown()
}

/**
* @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()
Expand All @@ -97,7 +97,7 @@ public function testEntitiesMustHaveAToStringMethod()
}

/**
* @expectedException \Symfony\Component\Form\Exception\FormException
* @expectedException \Symfony\Component\Form\Exception\RuntimeException
*/
public function testChoicesMustBeManaged()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
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;
Expand Down Expand Up @@ -379,8 +378,6 @@ private function load()
* @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)
{
Expand Down
26 changes: 0 additions & 26 deletions src/Symfony/Component/Form/Exception/Exception.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
*
* @author Bernhard Schussek <[email protected]>
*/
interface ExceptionInterface extends FormException
interface ExceptionInterface
{
}
24 changes: 0 additions & 24 deletions src/Symfony/Component/Form/Exception/FormException.php

This file was deleted.