diff --git a/src/Element.php b/src/Element.php index e24d66d5..1a8214b4 100644 --- a/src/Element.php +++ b/src/Element.php @@ -17,19 +17,19 @@ class Element implements InitializableInterface, LabelAwareInterface { - /** @var array */ + /** @var array */ protected $attributes = []; /** @var null|string */ protected $label; - /** @var array */ + /** @var array */ protected $labelAttributes = []; /** * Label specific options * - * @var array + * @var array */ protected $labelOptions = []; @@ -158,12 +158,7 @@ public function setOption(string $key, $value) return $this; } - /** - * Set a single element attribute - * - * @param mixed $value - * @return $this - */ + /** @inheritDoc */ public function setAttribute(string $key, $value) { // Do not include the value in the list of attributes @@ -175,11 +170,7 @@ public function setAttribute(string $key, $value) return $this; } - /** - * Retrieve a single element attribute - * - * @return mixed|null - */ + /** @inheritDoc */ public function getAttribute(string $key) { if (! isset($this->attributes[$key])) { @@ -209,11 +200,7 @@ public function hasAttribute(string $key): bool } /** - * Set many attributes at once - * - * Implementation will decide if this will overwrite or merge. - * - * @return $this + * @inheritDoc * @throws Exception\InvalidArgumentException */ public function setAttributes(iterable $arrayOrTraversable) @@ -224,9 +211,7 @@ public function setAttributes(iterable $arrayOrTraversable) return $this; } - /** - * Retrieve all attributes at once - */ + /** @inheritDoc */ public function getAttributes(): array { return $this->attributes; @@ -235,7 +220,7 @@ public function getAttributes(): array /** * Remove many attributes at once * - * @param array $keys + * @param list $keys * @return $this */ public function removeAttributes(array $keys) @@ -307,7 +292,7 @@ public function getLabel(): ?string /** * Set the attributes to use with the label * - * @param array $labelAttributes + * @param array $labelAttributes * @return $this */ public function setLabelAttributes(array $labelAttributes) @@ -319,7 +304,7 @@ public function setLabelAttributes(array $labelAttributes) /** * Get the attributes to use with the label * - * @return array + * @return array */ public function getLabelAttributes(): array { diff --git a/src/Element/Button.php b/src/Element/Button.php index 54c187c5..5a9ba82f 100644 --- a/src/Element/Button.php +++ b/src/Element/Button.php @@ -8,11 +8,7 @@ class Button extends Element { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'button', ]; diff --git a/src/Element/Checkbox.php b/src/Element/Checkbox.php index e2c5b13c..e9d58583 100644 --- a/src/Element/Checkbox.php +++ b/src/Element/Checkbox.php @@ -11,11 +11,7 @@ class Checkbox extends Element implements InputProviderInterface { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'checkbox', ]; diff --git a/src/Element/Color.php b/src/Element/Color.php index c91f3776..867ad059 100644 --- a/src/Element/Color.php +++ b/src/Element/Color.php @@ -13,11 +13,7 @@ class Color extends Element implements InputProviderInterface { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'color', ]; diff --git a/src/Element/Csrf.php b/src/Element/Csrf.php index f50667b8..b01fbd31 100644 --- a/src/Element/Csrf.php +++ b/src/Element/Csrf.php @@ -16,11 +16,7 @@ class Csrf extends Element implements InputProviderInterface, ElementPrepareAwareInterface { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'hidden', ]; @@ -103,6 +99,8 @@ public function getValue(): string * Override: get attributes * * Seeds 'value' attribute with validator hash + * + * @inheritDoc */ public function getAttributes(): array { diff --git a/src/Element/Date.php b/src/Element/Date.php index 337ddbf0..2a5614a2 100644 --- a/src/Element/Date.php +++ b/src/Element/Date.php @@ -14,11 +14,7 @@ class Date extends DateTimeElement { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'date', ]; diff --git a/src/Element/DateTime.php b/src/Element/DateTime.php index 66bea7a4..56a09aa0 100644 --- a/src/Element/DateTime.php +++ b/src/Element/DateTime.php @@ -11,11 +11,7 @@ */ class DateTime extends AbstractDateTime { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'datetime', ]; diff --git a/src/Element/DateTimeLocal.php b/src/Element/DateTimeLocal.php index 93d63bb2..2dad44ee 100644 --- a/src/Element/DateTimeLocal.php +++ b/src/Element/DateTimeLocal.php @@ -10,11 +10,7 @@ class DateTimeLocal extends AbstractDateTime { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'datetime-local', ]; diff --git a/src/Element/Email.php b/src/Element/Email.php index 8ad8f83b..bd578319 100644 --- a/src/Element/Email.php +++ b/src/Element/Email.php @@ -13,11 +13,7 @@ class Email extends Element implements InputProviderInterface { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'email', ]; diff --git a/src/Element/File.php b/src/Element/File.php index 6f4b794e..65d96c05 100644 --- a/src/Element/File.php +++ b/src/Element/File.php @@ -12,11 +12,7 @@ class File extends Element implements InputProviderInterface, ElementPrepareAwareInterface { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'file', ]; diff --git a/src/Element/Hidden.php b/src/Element/Hidden.php index 10160fdb..c9ec1e08 100644 --- a/src/Element/Hidden.php +++ b/src/Element/Hidden.php @@ -8,11 +8,7 @@ class Hidden extends Element { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'hidden', ]; diff --git a/src/Element/Image.php b/src/Element/Image.php index 79792828..b754962b 100644 --- a/src/Element/Image.php +++ b/src/Element/Image.php @@ -8,11 +8,7 @@ class Image extends Element { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'image', ]; diff --git a/src/Element/Month.php b/src/Element/Month.php index a38d03f3..463e2fa4 100644 --- a/src/Element/Month.php +++ b/src/Element/Month.php @@ -18,11 +18,7 @@ class Month extends AbstractDateTime */ protected $format = '!Y-m'; - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'month', ]; diff --git a/src/Element/MultiCheckbox.php b/src/Element/MultiCheckbox.php index bec7acc1..4d34d1d3 100644 --- a/src/Element/MultiCheckbox.php +++ b/src/Element/MultiCheckbox.php @@ -14,11 +14,7 @@ class MultiCheckbox extends Checkbox { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'multi_checkbox', ]; @@ -99,12 +95,7 @@ public function setOptions(iterable $options) return $this; } - /** - * Set a single element attribute - * - * @param mixed $value - * @return $this - */ + /** @inheritDoc */ public function setAttribute(string $key, $value) { // Do not include the options in the list of attributes diff --git a/src/Element/Number.php b/src/Element/Number.php index 464628e1..c63722c8 100644 --- a/src/Element/Number.php +++ b/src/Element/Number.php @@ -15,11 +15,7 @@ class Number extends Element implements InputProviderInterface { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'number', ]; diff --git a/src/Element/Password.php b/src/Element/Password.php index f37adbb8..94759f5b 100644 --- a/src/Element/Password.php +++ b/src/Element/Password.php @@ -10,11 +10,7 @@ class Password extends Element implements ElementPrepareAwareInterface { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'password', ]; diff --git a/src/Element/Radio.php b/src/Element/Radio.php index 3efd8264..dbea92d4 100644 --- a/src/Element/Radio.php +++ b/src/Element/Radio.php @@ -9,11 +9,7 @@ class Radio extends MultiCheckbox { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'radio', ]; diff --git a/src/Element/Range.php b/src/Element/Range.php index 983819b0..9c53a468 100644 --- a/src/Element/Range.php +++ b/src/Element/Range.php @@ -13,11 +13,7 @@ class Range extends NumberElement { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'range', ]; diff --git a/src/Element/Search.php b/src/Element/Search.php index ad3878b9..566a7abd 100644 --- a/src/Element/Search.php +++ b/src/Element/Search.php @@ -8,11 +8,7 @@ class Search extends Element { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'search', ]; diff --git a/src/Element/Select.php b/src/Element/Select.php index 899c8ea9..f429ba33 100644 --- a/src/Element/Select.php +++ b/src/Element/Select.php @@ -16,11 +16,7 @@ class Select extends Element implements InputProviderInterface { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'select', ]; @@ -134,12 +130,7 @@ public function setOptions(iterable $options) return $this; } - /** - * Set a single element attribute - * - * @param mixed $value - * @return $this - */ + /** @inheritDoc */ public function setAttribute(string $key, $value) { // Do not include the options in the list of attributes diff --git a/src/Element/Submit.php b/src/Element/Submit.php index 00688b62..40d6fa77 100644 --- a/src/Element/Submit.php +++ b/src/Element/Submit.php @@ -8,11 +8,7 @@ class Submit extends Element { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'submit', ]; diff --git a/src/Element/Tel.php b/src/Element/Tel.php index 6ddf27d3..856dcc5e 100644 --- a/src/Element/Tel.php +++ b/src/Element/Tel.php @@ -13,11 +13,7 @@ class Tel extends Element implements InputProviderInterface { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'tel', ]; diff --git a/src/Element/Text.php b/src/Element/Text.php index 43b4df8f..90b9fbc1 100644 --- a/src/Element/Text.php +++ b/src/Element/Text.php @@ -8,11 +8,7 @@ class Text extends Element { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'text', ]; diff --git a/src/Element/Textarea.php b/src/Element/Textarea.php index 463c9890..c5d8bf37 100644 --- a/src/Element/Textarea.php +++ b/src/Element/Textarea.php @@ -8,11 +8,7 @@ class Textarea extends Element { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'textarea', ]; diff --git a/src/Element/Time.php b/src/Element/Time.php index 68cb02e7..621e1dd5 100644 --- a/src/Element/Time.php +++ b/src/Element/Time.php @@ -12,11 +12,7 @@ class Time extends AbstractDateTime { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'time', ]; diff --git a/src/Element/Url.php b/src/Element/Url.php index f5572ac8..02ad7781 100644 --- a/src/Element/Url.php +++ b/src/Element/Url.php @@ -12,11 +12,7 @@ class Url extends Element implements InputProviderInterface { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'url', ]; diff --git a/src/Element/Week.php b/src/Element/Week.php index 51fd02f7..a0869c56 100644 --- a/src/Element/Week.php +++ b/src/Element/Week.php @@ -13,11 +13,7 @@ class Week extends AbstractDateTime { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'type' => 'week', ]; diff --git a/src/ElementAttributeRemovalInterface.php b/src/ElementAttributeRemovalInterface.php index 1ab68abc..7eb577f1 100644 --- a/src/ElementAttributeRemovalInterface.php +++ b/src/ElementAttributeRemovalInterface.php @@ -16,6 +16,7 @@ public function removeAttribute(string $key); /** * Remove many attributes at once * + * @param list $keys * @return $this */ public function removeAttributes(array $keys); diff --git a/src/ElementInterface.php b/src/ElementInterface.php index c74359fd..de3c4351 100644 --- a/src/ElementInterface.php +++ b/src/ElementInterface.php @@ -52,6 +52,7 @@ public function getOption(string $option); /** * Set a single element attribute * + * @param scalar|null $value * @return $this */ public function setAttribute(string $key, mixed $value); @@ -59,7 +60,7 @@ public function setAttribute(string $key, mixed $value); /** * Retrieve a single element attribute * - * @return mixed + * @return scalar|null */ public function getAttribute(string $key); @@ -73,12 +74,15 @@ public function hasAttribute(string $key): bool; * * Implementation will decide if this will overwrite or merge. * + * @param iterable $arrayOrTraversable * @return $this */ public function setAttributes(iterable $arrayOrTraversable); /** * Retrieve all attributes at once + * + * @return array */ public function getAttributes(): array; diff --git a/src/Form.php b/src/Form.php index 5ac66374..9fbfc1f5 100644 --- a/src/Form.php +++ b/src/Form.php @@ -26,11 +26,7 @@ class Form extends Fieldset implements FormInterface { - /** - * Seed attributes - * - * @var array - */ + /** @var array */ protected $attributes = [ 'method' => 'POST', ]; diff --git a/src/LabelAwareInterface.php b/src/LabelAwareInterface.php index 8f15047d..f59b9b54 100644 --- a/src/LabelAwareInterface.php +++ b/src/LabelAwareInterface.php @@ -21,7 +21,7 @@ public function getLabel(): ?string; /** * Set the attributes to use with the label * - * @param array $labelAttributes + * @param array $labelAttributes * @return $this */ public function setLabelAttributes(array $labelAttributes);