File tree 7 files changed +8
-61
lines changed 7 files changed +8
-61
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Bridge \Doctrine \Form \ChoiceList ;
13
13
14
- use Symfony \Component \Form \Exception \Exception ;
14
+ use Symfony \Component \Form \Exception \RuntimeException ;
15
15
use Symfony \Component \Form \Exception \StringCastException ;
16
16
use Symfony \Component \Form \Extension \Core \ChoiceList \ObjectChoiceList ;
17
17
use Doctrine \Common \Persistence \ObjectManager ;
@@ -406,12 +406,12 @@ private function load()
406
406
*
407
407
* @return array The identifier values
408
408
*
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
410
410
*/
411
411
private function getIdentifierValues ($ entity )
412
412
{
413
413
if (!$ this ->em ->contains ($ entity )) {
414
- throw new Exception (
414
+ throw new RuntimeException (
415
415
'Entities passed to the choice field must be managed. Maybe ' .
416
416
'persist them in the entity manager? '
417
417
);
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Bridge \Doctrine \Form \Type ;
13
13
14
14
use Doctrine \Common \Persistence \ManagerRegistry ;
15
- use Symfony \Component \Form \Exception \Exception ;
15
+ use Symfony \Component \Form \Exception \RuntimeException ;
16
16
use Doctrine \Common \Persistence \ObjectManager ;
17
17
use Symfony \Component \Form \FormBuilderInterface ;
18
18
use Symfony \Bridge \Doctrine \Form \ChoiceList \EntityChoiceList ;
@@ -144,7 +144,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
144
144
$ em = $ registry ->getManagerForClass ($ options ['class ' ]);
145
145
146
146
if (null === $ em ) {
147
- throw new Exception (sprintf (
147
+ throw new RuntimeException (sprintf (
148
148
'Class "%s" seems not to be a managed Doctrine entity. ' .
149
149
'Did you forget to map it? ' ,
150
150
$ options ['class ' ]
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ protected function tearDown()
70
70
}
71
71
72
72
/**
73
- * @expectedException \Symfony\Component\Form\Exception\FormException
73
+ * @expectedException \Symfony\Component\Form\Exception\StringCastException
74
74
* @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).
75
75
*/
76
76
public function testEntitiesMustHaveAToStringMethod ()
@@ -97,7 +97,7 @@ public function testEntitiesMustHaveAToStringMethod()
97
97
}
98
98
99
99
/**
100
- * @expectedException \Symfony\Component\Form\Exception\FormException
100
+ * @expectedException \Symfony\Component\Form\Exception\RuntimeException
101
101
*/
102
102
public function testChoicesMustBeManaged ()
103
103
{
Original file line number Diff line number Diff line change 15
15
use \BaseObject ;
16
16
use \Persistent ;
17
17
18
- use Symfony \Component \Form \Exception \FormException ;
19
18
use Symfony \Component \Form \Exception \StringCastException ;
20
19
use Symfony \Component \Form \Extension \Core \ChoiceList \ObjectChoiceList ;
21
20
use Symfony \Component \PropertyAccess \PropertyAccessorInterface ;
@@ -379,8 +378,6 @@ private function load()
379
378
* @param object $model The model for which to get the identifier
380
379
*
381
380
* @return array
382
- *
383
- * @throws FormException If the model does not exist
384
381
*/
385
382
private function getIdentifierValues ($ model )
386
383
{
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 16
16
*
17
17
* @author Bernhard Schussek <[email protected] >
18
18
*/
19
- interface ExceptionInterface extends FormException
19
+ interface ExceptionInterface
20
20
{
21
21
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments