Skip to content

Commit

Permalink
add array option to setAttributes and removes string option
Browse files Browse the repository at this point in the history
  • Loading branch information
LeMatosDeFuk committed Dec 22, 2023
1 parent 1f14abf commit 7b13b1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/column.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ class MyClass
### `setAttributes(array $attributes): static`

This method sets the attributes of the column. The attributes are HTML attributes that are applied to the column tag.
You can pass a callable, a class method, or an array.
You can pass a callable, a class method or an array.

```php
public function setAttributes(array $attributes): static
public function setAttributes(callable|array $attributes): static
```

```php
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/HasAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public function getAttributes(): callable
return $this->attributes;
}

public function setAttributes(callable|string $attributes): static
public function setAttributes(callable|array $attributes): static
{
if (is_string($attributes)) {
if (is_array($attributes)) {
$attributes = fn() => $attributes;
}

Expand Down

0 comments on commit 7b13b1d

Please sign in to comment.