diff --git a/src/Contracts/Elements/HtmlElement.php b/src/Contracts/Elements/HtmlElement.php index 4cde414..17c3613 100644 --- a/src/Contracts/Elements/HtmlElement.php +++ b/src/Contracts/Elements/HtmlElement.php @@ -5,6 +5,7 @@ namespace Arcanedev\Html\Contracts\Elements; use Arcanedev\Html\Contracts\Renderable; +use Arcanedev\Html\Entities\Attributes; /** * Interface HtmlElement @@ -20,10 +21,8 @@ interface HtmlElement extends Renderable /** * Get the element attributes. - * - * @return \Arcanedev\Html\Entities\Attributes */ - public function getAttributes(); + public function getAttributes(): Attributes; /* ----------------------------------------------------------------- | Main Methods diff --git a/src/Contracts/Html.php b/src/Contracts/Html.php index d17ef71..38f8f8e 100644 --- a/src/Contracts/Html.php +++ b/src/Contracts/Html.php @@ -4,7 +4,6 @@ namespace Arcanedev\Html\Contracts; -use Arcanedev\Html\Contracts\Elements\HtmlElement; use Arcanedev\Html\Elements\A; use Arcanedev\Html\Elements\Button; use Arcanedev\Html\Elements\Div; @@ -12,10 +11,12 @@ use Arcanedev\Html\Elements\Fieldset; use Arcanedev\Html\Elements\File; use Arcanedev\Html\Elements\Form; +use Arcanedev\Html\Elements\HtmlElement; use Arcanedev\Html\Elements\I; use Arcanedev\Html\Elements\Img; use Arcanedev\Html\Elements\Input; use Arcanedev\Html\Elements\Label; +use Arcanedev\Html\Elements\Legend; use Arcanedev\Html\Elements\Ol; use Arcanedev\Html\Elements\Option; use Arcanedev\Html\Elements\Select; @@ -127,12 +128,8 @@ public function label(mixed $content = null, ?string $for = null): Label; /** * Make a legend tag. - * - * @param \Arcanedev\Html\Elements\HtmlElement|string|null $content - * - * @return \Arcanedev\Html\Elements\Legend */ - public function legend($content = null); + public function legend(HtmlElement|string $content = null): Legend; /** * Make a mailto link. @@ -198,12 +195,8 @@ public function span(mixed $content = null): Span; /** * Make a submit button. - * - * @param string|null $text - * - * @return \Arcanedev\Html\Elements\Button */ - public function submit($text = null); + public function submit(string $text = null): Button; /** * Make a tel link. @@ -222,12 +215,6 @@ public function textarea(?string $name = null, ?string $value = null): Textarea; /** * Make a time input. - * - * @param string|null $name - * @param string|null $value - * @param bool $format - * - * @return \Arcanedev\Html\Elements\Input */ public function time(?string $name = null, ?string $value = null, bool $format = true): Input; diff --git a/src/Elements/HtmlElement.php b/src/Elements/HtmlElement.php index 377ccfe..7cea9b0 100644 --- a/src/Elements/HtmlElement.php +++ b/src/Elements/HtmlElement.php @@ -279,13 +279,7 @@ public function __toString(): string } /** - * Dynamically handle calls to the class. - * Check for methods finishing by If or fallback to Macroable. - * - * @param string $name - * @param array $arguments - * - * @return mixed + * @inheritDoc */ public function __call($name, array $arguments = []) { diff --git a/src/Entities/Attributes.php b/src/Entities/Attributes.php index 6a462ae..d20f950 100644 --- a/src/Entities/Attributes.php +++ b/src/Entities/Attributes.php @@ -105,7 +105,7 @@ public function forget(array|string $keys): static /** * Determine if an item exists in the collection by key. * - * @param array<string> ...$keys + * @param string|array<string> ...$keys * * @return bool */ diff --git a/src/Entities/Attributes/AbstractAttribute.php b/src/Entities/Attributes/AbstractAttribute.php index 47a27af..fe4f431 100644 --- a/src/Entities/Attributes/AbstractAttribute.php +++ b/src/Entities/Attributes/AbstractAttribute.php @@ -16,6 +16,9 @@ abstract class AbstractAttribute | ----------------------------------------------------------------- */ + /** + * The attribute's name. + */ protected string $name; /* ----------------------------------------------------------------- diff --git a/src/Entities/Attributes/ClassAttribute.php b/src/Entities/Attributes/ClassAttribute.php index 92cb228..4da5f46 100644 --- a/src/Entities/Attributes/ClassAttribute.php +++ b/src/Entities/Attributes/ClassAttribute.php @@ -22,8 +22,16 @@ class ClassAttribute extends AbstractAttribute implements Countable | ----------------------------------------------------------------- */ + /** + * The attribute's name. + */ protected string $name = 'class'; + /** + * The CSS classes. + * + * @var array<int, string> + */ protected array $classes = []; /* ----------------------------------------------------------------- diff --git a/src/Entities/Attributes/MiscAttribute.php b/src/Entities/Attributes/MiscAttribute.php index ddc4a62..c1e097c 100644 --- a/src/Entities/Attributes/MiscAttribute.php +++ b/src/Entities/Attributes/MiscAttribute.php @@ -16,6 +16,11 @@ class MiscAttribute extends AbstractAttribute | ----------------------------------------------------------------- */ + /** + * The attribute's value. + * + * @var mixed + */ protected mixed $value; /* ----------------------------------------------------------------- diff --git a/src/Entities/ChildrenCollection.php b/src/Entities/ChildrenCollection.php index 0361f4b..fd74773 100644 --- a/src/Entities/ChildrenCollection.php +++ b/src/Entities/ChildrenCollection.php @@ -26,10 +26,7 @@ class ChildrenCollection extends Collection implements Renderable /** * Parse the element's children. * - * @param mixed $children - * @param \Closure|null $mapper - * - * @return static + * @return $this * * @throws \Arcanedev\Html\Exceptions\InvalidChildException */ diff --git a/src/Html.php b/src/Html.php index b684d8d..bc4eda4 100644 --- a/src/Html.php +++ b/src/Html.php @@ -228,7 +228,7 @@ public function label(mixed $content = null, ?string $for = null): Label /** * Make a legend tag. */ - public function legend(mixed $content = null): Legend + public function legend(HtmlElement|string $content = null): Legend { return Legend::make()->html($content); } @@ -341,7 +341,7 @@ public function span(mixed $content = null): Span /** * Make a submit button. */ - public function submit(mixed $text = null): Button + public function submit(string $text = null): Button { return $this->button($text, 'submit'); }