diff --git a/src/Symfony/Components/DomCrawler/Crawler.php b/src/Symfony/Components/DomCrawler/Crawler.php index 5408c3dbb9..bddeb31150 100644 --- a/src/Symfony/Components/DomCrawler/Crawler.php +++ b/src/Symfony/Components/DomCrawler/Crawler.php @@ -292,6 +292,8 @@ class Crawler extends \SplObjectStorage * Returns the siblings nodes of the current selection * * @return Crawler A Crawler instance with the sibling nodes + * + * @throws \InvalidArgumentException When current node is empty */ public function siblings() { @@ -307,6 +309,8 @@ class Crawler extends \SplObjectStorage * Returns the next siblings nodes of the current selection * * @return Crawler A Crawler instance with the next sibling nodes + * + * @throws \InvalidArgumentException When current node is empty */ public function nextAll() { @@ -337,6 +341,8 @@ class Crawler extends \SplObjectStorage * Returns the parents nodes of the current selection * * @return Crawler A Crawler instance with the parents nodes of the current selection + * + * @throws \InvalidArgumentException When current node is empty */ public function parents() { @@ -362,7 +368,9 @@ class Crawler extends \SplObjectStorage /** * Returns the children nodes of the current selection * - * @return Crawler A Crawler instance with the chidren nodes + * @return Crawler A Crawler instance with the children nodes + * + * @throws \InvalidArgumentException When current node is empty */ public function children() { @@ -380,6 +388,8 @@ class Crawler extends \SplObjectStorage * @param string $attribute The attribute name * * @return string The attribute value + * + * @throws \InvalidArgumentException When current node is empty */ public function attr($attribute) { @@ -395,6 +405,8 @@ class Crawler extends \SplObjectStorage * Returns the node value of the first node of the list. * * @return string The node value + * + * @throws \InvalidArgumentException When current node is empty */ public function text() { diff --git a/src/Symfony/Components/DomCrawler/Field/ChoiceFormField.php b/src/Symfony/Components/DomCrawler/Field/ChoiceFormField.php index 59173017b6..fd02495b41 100644 --- a/src/Symfony/Components/DomCrawler/Field/ChoiceFormField.php +++ b/src/Symfony/Components/DomCrawler/Field/ChoiceFormField.php @@ -46,6 +46,8 @@ class ChoiceFormField extends FormField * Sets the value of the field. * * @param string $value The value of the field + * + * @throws \InvalidArgumentException When value type provided is not correct */ public function setValue($value) { @@ -103,6 +105,8 @@ class ChoiceFormField extends FormField * This method should only be used internally. * * @param \DOMNode $node A \DOMNode + * + * @throws \LogicException When choice provided is not multiple nor radio */ public function addChoice(\DOMNode $node) { @@ -141,6 +145,8 @@ class ChoiceFormField extends FormField /** * Initializes the form field. + * + * @throws \LogicException When node type is incorrect */ protected function initialize() { diff --git a/src/Symfony/Components/DomCrawler/Field/FileFormField.php b/src/Symfony/Components/DomCrawler/Field/FileFormField.php index 40f9ee16bc..ef87a85a90 100644 --- a/src/Symfony/Components/DomCrawler/Field/FileFormField.php +++ b/src/Symfony/Components/DomCrawler/Field/FileFormField.php @@ -24,6 +24,8 @@ class FileFormField extends FormField * Sets the PHP error code associated with the field. * * @param integer $error The error code (one of UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE, UPLOAD_ERR_PARTIAL, UPLOAD_ERR_NO_FILE, UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_CANT_WRITE, or UPLOAD_ERR_EXTENSION) + * + * @throws \InvalidArgumentException When error code doesn't exist */ public function setErrorCode($error) { @@ -60,6 +62,8 @@ class FileFormField extends FormField /** * Initializes the form field. + * + * @throws \LogicException When node type is incorrect */ protected function initialize() { diff --git a/src/Symfony/Components/DomCrawler/Field/InputFormField.php b/src/Symfony/Components/DomCrawler/Field/InputFormField.php index d15b6c4df1..fa951c4010 100644 --- a/src/Symfony/Components/DomCrawler/Field/InputFormField.php +++ b/src/Symfony/Components/DomCrawler/Field/InputFormField.php @@ -25,6 +25,8 @@ class InputFormField extends FormField { /** * Initializes the form field. + * + * @throws \LogicException When node type is incorrect */ protected function initialize() { diff --git a/src/Symfony/Components/DomCrawler/Field/TextareaFormField.php b/src/Symfony/Components/DomCrawler/Field/TextareaFormField.php index cb93f0702f..4a9385b11e 100644 --- a/src/Symfony/Components/DomCrawler/Field/TextareaFormField.php +++ b/src/Symfony/Components/DomCrawler/Field/TextareaFormField.php @@ -22,6 +22,8 @@ class TextareaFormField extends FormField { /** * Initializes the form field. + * + * @throws \LogicException When node type is incorrect */ protected function initialize() { diff --git a/src/Symfony/Components/DomCrawler/Form.php b/src/Symfony/Components/DomCrawler/Form.php index 0934278ab5..987455ddc7 100644 --- a/src/Symfony/Components/DomCrawler/Form.php +++ b/src/Symfony/Components/DomCrawler/Form.php @@ -273,6 +273,8 @@ class Form * @param string $name The field name * * @return Field\FormField The field instance + * + * @throws \InvalidArgumentException When field is not present in this form */ public function getField($name) {