Skip to content

Commit

Permalink
[Form] raise OutOfBoundsException instead of InvalidArgumentException…
Browse files Browse the repository at this point in the history
… for inexistent form childs to be in line with PropertyPath
  • Loading branch information
Tobion committed Aug 28, 2012
1 parent 5018dae commit 65db978
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Form.php
Expand Up @@ -910,7 +910,7 @@ public function get($name)
return $this->children[$name];
}

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

/**
Expand All @@ -932,7 +932,7 @@ public function offsetExists($name)
*
* @return FormInterface The child form
*
* @throws \InvalidArgumentException If the named child does not exist.
* @throws \OutOfBoundsException If the named child does not exist.
*/
public function offsetGet($name)
{
Expand Down
2 changes: 1 addition & 1 deletion FormInterface.php
Expand Up @@ -64,7 +64,7 @@ public function add(FormInterface $child);
*
* @return FormInterface The child form
*
* @throws \InvalidArgumentException If the named child does not exist.
* @throws \OutOfBoundsException If the named child does not exist.
*/
public function get($name);

Expand Down

0 comments on commit 65db978

Please sign in to comment.