From a12b8935920cb96209394e1d25c2a7acf7cd84d0 Mon Sep 17 00:00:00 2001 From: George Steel Date: Thu, 16 Nov 2023 21:59:55 +0000 Subject: [PATCH 1/7] Improve type inference for element attributes Marks all attribute arrays and iterables as `` Signed-off-by: George Steel --- src/Element.php | 35 +++++++----------------- src/Element/Button.php | 6 +--- src/Element/Checkbox.php | 6 +--- src/Element/Color.php | 6 +--- src/Element/Csrf.php | 8 ++---- src/Element/Date.php | 6 +--- src/Element/DateTime.php | 6 +--- src/Element/DateTimeLocal.php | 6 +--- src/Element/Email.php | 6 +--- src/Element/File.php | 6 +--- src/Element/Hidden.php | 6 +--- src/Element/Image.php | 6 +--- src/Element/Month.php | 6 +--- src/Element/MultiCheckbox.php | 13 ++------- src/Element/Number.php | 6 +--- src/Element/Password.php | 6 +--- src/Element/Radio.php | 6 +--- src/Element/Range.php | 6 +--- src/Element/Search.php | 6 +--- src/Element/Select.php | 13 ++------- src/Element/Submit.php | 6 +--- src/Element/Tel.php | 6 +--- src/Element/Text.php | 6 +--- src/Element/Textarea.php | 6 +--- src/Element/Time.php | 6 +--- src/Element/Url.php | 6 +--- src/Element/Week.php | 6 +--- src/ElementAttributeRemovalInterface.php | 1 + src/ElementInterface.php | 6 +++- src/Form.php | 6 +--- src/LabelAwareInterface.php | 2 +- 31 files changed, 48 insertions(+), 174 deletions(-) diff --git a/src/Element.php b/src/Element.php index e24d66d59..1a8214b4c 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 54c187c58..5a9ba82f7 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 e2c5b13c2..e9d585837 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 c91f37764..867ad0599 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 f50667b89..b01fbd314 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 337ddbf03..2a5614a20 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 66bea7a4d..56a09aa0a 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 93d63bb29..2dad44ee5 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 8ad8f83b3..bd5783199 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 6f4b794ec..65d96c051 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 10160fdb8..c9ec1e08b 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 79792828c..b754962bc 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 a38d03f39..463e2fa47 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 bec7acc12..4d34d1d37 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 464628e15..c63722c81 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 f37adbb8e..94759f5b1 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 3efd82647..dbea92d46 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 983819b00..9c53a468e 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 ad3878b9a..566a7abde 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 899c8ea93..f429ba335 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 00688b622..40d6fa778 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 6ddf27d3e..856dcc5e0 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 43b4df8fd..90b9fbc1b 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 463c9890a..c5d8bf37f 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 68cb02e7f..621e1dd50 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 f5572ac8e..02ad77818 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 51fd02f7b..a0869c568 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 1ab68abc3..7eb577f17 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 c74359fdf..de3c4351c 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 5ac66374e..9fbfc1f5c 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 8f15047d2..f59b9b54c 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); From e80c32064180d81320450e4730e82a87b66d4a5b Mon Sep 17 00:00:00 2001 From: George Steel Date: Fri, 17 Nov 2023 09:19:15 +0000 Subject: [PATCH 2/7] qa: Assert that the name attribute is either string or null Signed-off-by: George Steel --- src/Element.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Element.php b/src/Element.php index 1a8214b4c..9c698cdc5 100644 --- a/src/Element.php +++ b/src/Element.php @@ -9,6 +9,7 @@ use Traversable; use function array_key_exists; +use function assert; use function is_string; class Element implements @@ -87,7 +88,10 @@ public function setName(string $name) */ public function getName(): ?string { - return $this->getAttribute('name'); + $name = $this->getAttribute('name'); + assert(is_string($name) || $name === null); + + return $name; } /** From 3aec8412fec91c5adb5f0803acfdbacccdd03e0e Mon Sep 17 00:00:00 2001 From: George Steel Date: Fri, 17 Nov 2023 10:23:00 +0000 Subject: [PATCH 3/7] qa: Fix psalm issues due to improved types for attributes and deprecate setting value options via attributes Signed-off-by: George Steel --- psalm-baseline.xml | 130 +++------------------ src/Element/AbstractDateTime.php | 12 +- src/Element/DateSelect.php | 5 +- src/Element/DateTimeSelect.php | 10 +- src/Element/MonthSelect.php | 8 +- src/Element/MultiCheckbox.php | 14 ++- src/Element/Select.php | 14 ++- src/View/Helper/AbstractHelper.php | 2 +- src/View/Helper/FormButton.php | 3 +- src/View/Helper/FormElement.php | 9 +- src/View/Helper/FormInput.php | 3 +- test/Element/EmailTest.php | 6 +- test/Element/MultiCheckboxTest.php | 50 ++++++-- test/Element/RadioTest.php | 10 +- test/Element/SelectTest.php | 20 ++++ test/View/Helper/FormButtonTest.php | 4 +- test/View/Helper/FormColorTest.php | 4 +- test/View/Helper/FormDateTest.php | 4 +- test/View/Helper/FormDateTimeLocalTest.php | 4 +- test/View/Helper/FormDateTimeTest.php | 4 +- test/View/Helper/FormElementTest.php | 67 ++++++----- test/View/Helper/FormEmailTest.php | 4 +- test/View/Helper/FormFileTest.php | 4 +- test/View/Helper/FormHiddenTest.php | 4 +- test/View/Helper/FormImageTest.php | 4 +- test/View/Helper/FormInputTest.php | 4 +- test/View/Helper/FormMonthTest.php | 4 +- test/View/Helper/FormMultiCheckboxTest.php | 6 +- test/View/Helper/FormNumberTest.php | 4 +- test/View/Helper/FormPasswordTest.php | 2 +- test/View/Helper/FormRadioTest.php | 2 +- test/View/Helper/FormRangeTest.php | 4 +- test/View/Helper/FormResetTest.php | 4 +- test/View/Helper/FormRowTest.php | 2 +- test/View/Helper/FormSearchTest.php | 4 +- test/View/Helper/FormSelectTest.php | 8 +- test/View/Helper/FormSubmitTest.php | 4 +- test/View/Helper/FormTelTest.php | 4 +- test/View/Helper/FormTextTest.php | 4 +- test/View/Helper/FormTextareaTest.php | 2 +- test/View/Helper/FormTimeTest.php | 4 +- test/View/Helper/FormUrlTest.php | 4 +- test/View/Helper/FormWeekTest.php | 4 +- 43 files changed, 226 insertions(+), 243 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 42eeaee16..0f0cf4388 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + @@ -552,9 +552,6 @@ - - getValidator - @@ -601,6 +598,14 @@ + + [ + 'a' => 'A', + 'b' => 'B', + ], + ]]]> + @@ -689,6 +694,12 @@ + + true, + 'options' => $valueOptions, + ]]]> + @@ -1101,9 +1112,6 @@ $element - - getAttribute($attribute)]]> - @@ -1120,28 +1128,10 @@ setView - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - new FormDateTimeHelper() - - getAttribute($attribute)]]> - @@ -1154,104 +1144,14 @@ getHash - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - $element - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - $escapeHelper($label) - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - - - - getAttribute($attribute)]]> - - diff --git a/src/Element/AbstractDateTime.php b/src/Element/AbstractDateTime.php index b83394801..ea959e00e 100644 --- a/src/Element/AbstractDateTime.php +++ b/src/Element/AbstractDateTime.php @@ -106,7 +106,7 @@ protected function getValidators(): array if ( isset($this->attributes['min']) - && $this->valueIsValidDateTimeFormat($this->attributes['min']) + && $this->valueIsValidDateTimeFormat((string) $this->attributes['min']) ) { $validators[] = new GreaterThanValidator([ 'min' => $this->attributes['min'], @@ -114,19 +114,19 @@ protected function getValidators(): array ]); } elseif ( isset($this->attributes['min']) - && ! $this->valueIsValidDateTimeFormat($this->attributes['min']) + && ! $this->valueIsValidDateTimeFormat((string) $this->attributes['min']) ) { throw new InvalidArgumentException(sprintf( '%1$s expects "min" to conform to %2$s; received "%3$s"', __METHOD__, $this->format, - $this->attributes['min'] + (string) $this->attributes['min'] )); } if ( isset($this->attributes['max']) - && $this->valueIsValidDateTimeFormat($this->attributes['max']) + && $this->valueIsValidDateTimeFormat((string) $this->attributes['max']) ) { $validators[] = new LessThanValidator([ 'max' => $this->attributes['max'], @@ -134,13 +134,13 @@ protected function getValidators(): array ]); } elseif ( isset($this->attributes['max']) - && ! $this->valueIsValidDateTimeFormat($this->attributes['max']) + && ! $this->valueIsValidDateTimeFormat((string) $this->attributes['max']) ) { throw new InvalidArgumentException(sprintf( '%1$s expects "max" to conform to %2$s; received "%3$s"', __METHOD__, $this->format, - $this->attributes['max'] + (string) $this->attributes['max'] )); } if ( diff --git a/src/Element/DateSelect.php b/src/Element/DateSelect.php index 5712b2e93..8d3d3ca6b 100644 --- a/src/Element/DateSelect.php +++ b/src/Element/DateSelect.php @@ -64,7 +64,7 @@ public function getDayElement(): Select /** * Get both the year and month elements * - * @return array + * @return list */ public function getElements(): array { return array_merge(parent::getElements(), [ @@ -124,6 +125,7 @@ public function getElements(): array /** * Set the hour attributes * + * @param array $hourAttributes * @return $this */ public function setHourAttributes(array $hourAttributes) @@ -135,7 +137,7 @@ public function setHourAttributes(array $hourAttributes) /** * Get the hour attributes * - * @return array + * @return array */ public function getHourAttributes(): array { @@ -145,6 +147,7 @@ public function getHourAttributes(): array /** * Set the minute attributes * + * @param array $minuteAttributes * @return $this */ public function setMinuteAttributes(array $minuteAttributes) @@ -156,7 +159,7 @@ public function setMinuteAttributes(array $minuteAttributes) /** * Get the minute attributes * - * @return array + * @return array */ public function getMinuteAttributes(): array { @@ -166,6 +169,7 @@ public function getMinuteAttributes(): array /** * Set the second attributes * + * @param array $secondAttributes * @return $this */ public function setSecondAttributes(array $secondAttributes) @@ -177,7 +181,7 @@ public function setSecondAttributes(array $secondAttributes) /** * Get the second attributes * - * @return array + * @return array */ public function getSecondAttributes(): array { diff --git a/src/Element/MonthSelect.php b/src/Element/MonthSelect.php index 46027f94d..4e66cb45a 100644 --- a/src/Element/MonthSelect.php +++ b/src/Element/MonthSelect.php @@ -142,7 +142,7 @@ public function getYearElement(): Select /** * Get both the year and month elements * - * @return array + * @return list