Skip to content

Commit

Permalink
Fix phpdoc for psalm.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Mar 14, 2024
1 parent 848e62d commit ca1056c
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- Enh #22: Add trait `HasLinkAreaCurrent` class (@terabytesoftw)
- Enh #23: Add trait `HasListItemAreaCurrent` class (@terabytesoftw)
- Bug #24: Fix `linkAriaCurrent()` and `listItemAriaCurrent()` methods to accept a boolean value. (@terabytesoftw)
- Bug #25: Fix `phpdoc` for `psalm` (@terabytesoftw)

## 0.1.1 March 9, 2024

Expand Down
5 changes: 5 additions & 0 deletions src/Component/HasFirstItemClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
*/
trait HasFirstItemClass
{
/**
* @psalm-var string|string[]
*/
protected array|string $firstItemClass = '';
protected bool $overrideFirstItemClass = true;

Expand All @@ -19,6 +22,8 @@ trait HasFirstItemClass
* @param bool $override Whether to override the current first item class or not.
*
* @return static A new instance of the current class with the specified first item class.
*
* @psalm-param string|string[] $value The `CSS` class for the first item tag.
*/
public function firstItemClass(array|string $value, bool $override = true): static
{
Expand Down
5 changes: 5 additions & 0 deletions src/Component/HasFirstLinkClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
*/
trait HasFirstLinkClass
{
/**
* @psalm-var string|string[]
*/
protected array|string $firstLinkClass = '';
protected bool $overrideFirstLinkClass = true;

Expand All @@ -19,6 +22,8 @@ trait HasFirstLinkClass
* @param bool $override Whether to override the current first link class or not.
*
* @return static A new instance of the current class with the specified first link class.
*
* @psalm-param string|string[] $value The `CSS` class for the first link tag.
*/
public function firstLinkClass(array|string $value, bool $override = true): static
{
Expand Down
5 changes: 5 additions & 0 deletions src/Component/HasLastItemClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
*/
trait HasLastItemClass
{
/**
* @psalm-var string|string[]
*/
protected array|string $lastItemClass = '';
protected bool $overrideLastItemClass = true;

Expand All @@ -19,6 +22,8 @@ trait HasLastItemClass
* @param bool $override Whether to override the current last item class or not.
*
* @return static A new instance of the current class with the specified last item class.
*
* @psalm-param string|string[] $value The `CSS` class for the last item tag.
*/
public function lastItemClass(array|string $value, bool $override = true): static
{
Expand Down
5 changes: 5 additions & 0 deletions src/Component/HasLastLinkClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
*/
trait HasLastLinkClass
{
/**
* @psalm-var string|string[]
*/
protected array|string $lastLinkClass = '';
protected bool $overrideLastLinkClass = true;

Expand All @@ -19,6 +22,8 @@ trait HasLastLinkClass
* @param bool $override Whether to override the current last link class or not.
*
* @return static A new instance of the current class with the specified last link class.
*
* @psalm-param string|string[] $value The `CSS` class for the last link tag.
*/
public function lastLinkClass(array|string $value, bool $override = true): static
{
Expand Down
6 changes: 4 additions & 2 deletions src/Component/HasLinkCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ public function linkAttributes(array $values): static
/**
* Sets the `CSS` class that will be assigned to the link.
*
* @param string $value The `CSS` class for the link tag.
* @param array|string $value The `CSS` class for the link tag.
* @param bool $override If `true` the value will be overridden.
*
* @return static A new instance of the current class with the specified link class.
*
* @psalm-param string|string[] $value The `CSS` class for the first link tag.
*/
public function linkClass(string $value, bool $override = false): static
public function linkClass(array|string $value, bool $override = false): static
{
$new = clone $this;
CssClass::add($new->linkAttributes, $value, $override);
Expand Down
4 changes: 3 additions & 1 deletion src/Component/HasListItemCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ public function listItemAttributes(array $values): static
/**
* Sets the `CSS` class that will be assigned to the list item.
*
* @param string $value The CSS class name.
* @param array|string $value The CSS class name.
* @param bool $override If `true` the value will be overridden.
*
* @return static A new instance of the current class with the specified class for tag `<li>`.
*
* @psalm-param string|string[] $value The `CSS` class for the first link tag.
*/
public function listItemClass(array|string $value, bool $override = false): static
{
Expand Down

0 comments on commit ca1056c

Please sign in to comment.