8000 merged branch Tobion/formincon (PR #5355) · bobihu/symfony@e49fd8f · GitHub
[go: up one dir, main page]

Skip to content

Commit e49fd8f

Browse files
committed
merged branch Tobion/formincon (PR symfony#5355)
Commits ------- 7e8ab54 [Form] raise OutOfBoundsException instead of InvalidArgumentException for inexistent form childs to be in line with PropertyPath Discussion ---------- [Form] raise OutOfBoundsException instead of InvalidArgumentException in Form::get BC break: yes Raise OutOfBoundsException instead of InvalidArgumentException in Form::get for inexistent form childs to be in line with PropertyPath, which also uses OutOfBoundsException for invalid indexes. OutOfBoundsException fits much better as it extends RuntimeException instead of LogicException and this error can typically not be detected at compile time. --------------------------------------------------------------------------- by bschussek at 2012-08-29T11:01:01Z :+1: --------------------------------------------------------------------------- by stloyd at 2012-08-29T11:07:51Z Shouldn't this change be noted in upgrade file ? --------------------------------------------------------------------------- by stof at 2012-08-29T11:23:04Z it should (and in the changelog of the component)
2 parents deb41a1 + 7e8ab54 commit e49fd8f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Symfony/Component/Form/Form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ public function get($name)
903903
return $this->children[$name];
904904
}
905905

906-
throw new \InvalidArgumentException(sprintf('Child "%s" does not exist.', $name));
906+
throw new \OutOfBoundsException(sprintf('Child "%s" does not exist.', $name));
907907
}
908908

909909
/**
@@ -925,7 +925,7 @@ public function offsetExists($name)
925925
*
926926
* @return FormInterface The child form
927927
*
928-
* @throws \InvalidArgumentException If the named child does not exist.
928+
* @throws \OutOfBoundsException If the named child does not exist.
929929
*/
930930
public function offsetGet($name)
931931
{

src/Symfony/Component/Form/FormInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function add(FormInterface $child);
5757
*
5858
* @return FormInterface The child form
5959
*
60-
* @throws \InvalidArgumentException If the named child does not exist.
60+
* @throws \OutOfBoundsException If the named child does not exist.
6161
*/
6262
public function get($name);
6363

0 commit comments

Comments
 (0)
0