Skip to content

Commit 45eb7af

Browse files
Fix phpdoc for psalm. (#25)
1 parent 848e62d commit 45eb7af

File tree

7 files changed

+28
-3
lines changed

7 files changed

+28
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- Enh #22: Add trait `HasLinkAreaCurrent` class (@terabytesoftw)
2424
- Enh #23: Add trait `HasListItemAreaCurrent` class (@terabytesoftw)
2525
- Bug #24: Fix `linkAriaCurrent()` and `listItemAriaCurrent()` methods to accept a boolean value. (@terabytesoftw)
26+
- Bug #25: Fix `phpdoc` for `psalm` (@terabytesoftw)
2627

2728
## 0.1.1 March 9, 2024
2829

src/Component/HasFirstItemClass.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
*/
1010
trait HasFirstItemClass
1111
{
12+
/**
13+
* @psalm-var string|string[]
14+
*/
1215
protected array|string $firstItemClass = '';
1316
protected bool $overrideFirstItemClass = true;
1417

@@ -19,6 +22,8 @@ trait HasFirstItemClass
1922
* @param bool $override Whether to override the current first item class or not.
2023
*
2124
* @return static A new instance of the current class with the specified first item class.
25+
*
26+
* @psalm-param string|string[] $value The `CSS` class for the first item tag.
2227
*/
2328
public function firstItemClass(array|string $value, bool $override = true): static
2429
{

src/Component/HasFirstLinkClass.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
*/
1010
trait HasFirstLinkClass
1111
{
12+
/**
13+
* @psalm-var string|string[]
14+
*/
1215
protected array|string $firstLinkClass = '';
1316
protected bool $overrideFirstLinkClass = true;
1417

@@ -19,6 +22,8 @@ trait HasFirstLinkClass
1922
* @param bool $override Whether to override the current first link class or not.
2023
*
2124
* @return static A new instance of the current class with the specified first link class.
25+
*
26+
* @psalm-param string|string[] $value The `CSS` class for the first link tag.
2227
*/
2328
public function firstLinkClass(array|string $value, bool $override = true): static
2429
{

src/Component/HasLastItemClass.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
*/
1010
trait HasLastItemClass
1111
{
12+
/**
13+
* @psalm-var string|string[]
14+
*/
1215
protected array|string $lastItemClass = '';
1316
protected bool $overrideLastItemClass = true;
1417

@@ -19,6 +22,8 @@ trait HasLastItemClass
1922
* @param bool $override Whether to override the current last item class or not.
2023
*
2124
* @return static A new instance of the current class with the specified last item class.
25+
*
26+
* @psalm-param string|string[] $value The `CSS` class for the last item tag.
2227
*/
2328
public function lastItemClass(array|string $value, bool $override = true): static
2429
{

src/Component/HasLastLinkClass.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
*/
1010
trait HasLastLinkClass
1111
{
12+
/**
13+
* @psalm-var string|string[]
14+
*/
1215
protected array|string $lastLinkClass = '';
1316
protected bool $overrideLastLinkClass = true;
1417

@@ -19,6 +22,8 @@ trait HasLastLinkClass
1922
* @param bool $override Whether to override the current last link class or not.
2023
*
2124
* @return static A new instance of the current class with the specified last link class.
25+
*
26+
* @psalm-param string|string[] $value The `CSS` class for the last link tag.
2227
*/
2328
public function lastLinkClass(array|string $value, bool $override = true): static
2429
{

src/Component/HasLinkCollection.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ public function linkAttributes(array $values): static
4242
/**
4343
* Sets the `CSS` class that will be assigned to the link.
4444
*
45-
* @param string $value The `CSS` class for the link tag.
45+
* @param array|string $value The `CSS` class for the link tag.
4646
* @param bool $override If `true` the value will be overridden.
4747
*
4848
* @return static A new instance of the current class with the specified link class.
49+
*
50+
* @psalm-param string|string[] $value The `CSS` class for the first link tag.
4951
*/
50-
public function linkClass(string $value, bool $override = false): static
52+
public function linkClass(array|string $value, bool $override = false): static
5153
{
5254
$new = clone $this;
5355
CssClass::add($new->linkAttributes, $value, $override);

src/Component/HasListItemCollection.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ public function listItemAttributes(array $values): static
4444
/**
4545
* Sets the `CSS` class that will be assigned to the list item.
4646
*
47-
* @param string $value The CSS class name.
47+
* @param array|string $value The CSS class name.
4848
* @param bool $override If `true` the value will be overridden.
4949
*
5050
* @return static A new instance of the current class with the specified class for tag `<li>`.
51+
*
52+
* @psalm-param string|string[] $value The `CSS` class for the first link tag.
5153
*/
5254
public function listItemClass(array|string $value, bool $override = false): static
5355
{

0 commit comments

Comments
 (0)