X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fdom-crawler%2FField%2FChoiceFormField.php;h=6f112b535007971bca78a8b1304832c22d008216;hb=refs%2Fheads%2Fmaster;hp=c479daa75ee780983a3e1c5abf1d057c389782fb;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/symfony/dom-crawler/Field/ChoiceFormField.php b/vendor/symfony/dom-crawler/Field/ChoiceFormField.php index c479daa75..6f112b535 100644 --- a/vendor/symfony/dom-crawler/Field/ChoiceFormField.php +++ b/vendor/symfony/dom-crawler/Field/ChoiceFormField.php @@ -45,7 +45,7 @@ class ChoiceFormField extends FormField public function hasValue() { // don't send a value for unchecked checkboxes - if (in_array($this->type, array('checkbox', 'radio')) && null === $this->value) { + if (\in_array($this->type, array('checkbox', 'radio')) && null === $this->value) { return false; } @@ -75,7 +75,7 @@ class ChoiceFormField extends FormField /** * Sets the value of the field. * - * @param string $value The value of the field + * @param string|array $value The value of the field */ public function select($value) { @@ -97,14 +97,14 @@ class ChoiceFormField extends FormField } /** - * Ticks a checkbox. + * Unticks a checkbox. * * @throws \LogicException When the type provided is not correct */ public function untick() { if ('checkbox' !== $this->type) { - throw new \LogicException(sprintf('You cannot tick "%s" as it is not a checkbox (%s).', $this->name, $this->type)); + throw new \LogicException(sprintf('You cannot untick "%s" as it is not a checkbox (%s).', $this->name, $this->type)); } $this->setValue(false); @@ -113,7 +113,7 @@ class ChoiceFormField extends FormField /** * Sets the value of the field. * - * @param string $value The value of the field + * @param string|array $value The value of the field * * @throws \InvalidArgumentException When value type provided is not correct */ @@ -126,7 +126,7 @@ class ChoiceFormField extends FormField // check $this->value = $this->options[0]['value']; } else { - if (is_array($value)) { + if (\is_array($value)) { if (!$this->multiple) { throw new \InvalidArgumentException(sprintf('The value for "%s" cannot be an array.', $this->name)); } @@ -144,7 +144,7 @@ class ChoiceFormField extends FormField $value = (array) $value; } - if (is_array($value)) { + if (\is_array($value)) { $this->value = $value; } else { parent::setValue($value);