Skip to content

Commit 9430d58

Browse files
lrljoegithub-actions[bot]
authored andcommitted
Fix styling
1 parent f0931c3 commit 9430d58

File tree

11 files changed

+29
-45
lines changed

11 files changed

+29
-45
lines changed

src/DataTransferObjects/Filters/FilterPillData.php

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44

55
class FilterPillData
66
{
7+
public function __construct(protected string $filterPillTitle, protected string $filterSelectName, protected string|array|null $filterPillValue, protected string $separator, public bool $isAnExternalLivewireFilter, public bool $hasCustomPillBlade, protected ?string $customPillBlade, protected array $filterPillsItemAttributes) {}
78

8-
public function __construct(protected string $filterPillTitle, protected string $filterSelectName, protected string|array|null $filterPillValue, protected string $separator, public bool $isAnExternalLivewireFilter, public bool $hasCustomPillBlade, protected ?string $customPillBlade, protected array $filterPillsItemAttributes)
9-
{
10-
}
11-
12-
public static function make(string $filterPillTitle, string $filterSelectName, string|array|null $filterPillValue, string $separator = ', ', bool $isAnExternalLivewireFilter = false, bool $hasCustomPillBlade = false, ?string $customPillBlade = null, array $filterPillsItemAttributes = []): FilterPillData
9+
public static function make(string $filterPillTitle, string $filterSelectName, string|array|null $filterPillValue, string $separator = ', ', bool $isAnExternalLivewireFilter = false, bool $hasCustomPillBlade = false, ?string $customPillBlade = null, array $filterPillsItemAttributes = []): FilterPillData
1310
{
1411
return new self($filterPillTitle, $filterSelectName, $filterPillValue, $separator, $isAnExternalLivewireFilter, $hasCustomPillBlade, $customPillBlade, $filterPillsItemAttributes);
1512
}
@@ -28,43 +25,36 @@ public function getPillValue(): array|string|null
2825
{
2926
return $this->filterPillValue;
3027
}
31-
28+
3229
public function isPillValueAnArray(): bool
3330
{
34-
return (!is_null($this->filterPillValue) && is_array($this->filterPillValue));
31+
return ! is_null($this->filterPillValue) && is_array($this->filterPillValue);
3532
}
3633

3734
public function getSeparatedPillValue(): array|string|null
3835
{
39-
if ($this->isPillValueAnArray())
40-
{
36+
if ($this->isPillValueAnArray()) {
4137
return implode($this->getSeparator(), $this->getPillValue());
42-
}
43-
else
44-
{
38+
} else {
4539
return $this->getPillValue();
4640
}
4741
}
4842

4943
public function getValueFromPillData(): array|string|null
5044
{
51-
if ($this->isPillValueAnArray())
52-
{
45+
if ($this->isPillValueAnArray()) {
5346
return implode($this->getSeparator(), $this->getPillValue());
54-
}
55-
else
56-
{
47+
} else {
5748
return $this->getPillValue();
5849
}
5950
}
6051

61-
6252
public function getHasCustomPillBlade(): bool
6353
{
6454
return $this->hasCustomPillBlade ?? false;
6555
}
6656

67-
public function getCustomPillBlade(): string|null
57+
public function getCustomPillBlade(): ?string
6858
{
6959
return $this->customPillBlade;
7060
}
@@ -76,12 +66,12 @@ public function getIsAnExternalLivewireFilter(): bool
7666

7767
public function getSeparator(): string
7868
{
79-
return $this->separator ?? ", ";
69+
return $this->separator ?? ', ';
8070
}
8171

8272
public function getFilterPillsItemAttributes(): array
8373
{
84-
return array_merge(['default' => true, 'default-colors' => true, 'default-styling' => true], $this->filterPillsItemAttributes);
74+
return array_merge(['default' => true, 'default-colors' => true, 'default-styling' => true], $this->filterPillsItemAttributes);
8575
}
8676

8777
public function toArray(): array

src/Traits/Core/Search/HandlesSearchStatus.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function getSearchStatus(): bool
1717
#[Computed]
1818
public function showSearchField(): bool
1919
{
20-
return ($this->searchIsEnabled() && $this->searchVisibilityIsEnabled());
20+
return $this->searchIsEnabled() && $this->searchVisibilityIsEnabled();
2121
}
2222

2323
#[Computed]

src/Traits/Filters/HandlesPillsData.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ public function getPillDataForFilter(): array
1919
$separator = method_exists($filter, 'getPillsSeparator') ? $filter->getPillsSeparator() : ', ';
2020

2121
$filterPillAttributes = $this->getFilterPillsItemAttributes();
22-
23-
if ($filter->hasPillAttributes())
24-
{
22+
23+
if ($filter->hasPillAttributes()) {
2524
$filterPillAttributes = array_merge($filterPillAttributes, $filter->getPillAttributes());
2625
}
2726
$filters[$filter->getKey()] = FilterPillData::make($filter->getFilterPillTitle(), $filterSelectName, $filter->getFilterPillValue($value), $separator, $isAnExternalLivewireFilter, $filter->hasCustomPillBlade(), $filter->getCustomPillBlade(), $filterPillAttributes);

src/Traits/Filters/HasFilterPills.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ trait HasFilterPills
1717
public bool $filterPillsStatus = true;
1818

1919
public array $externalFilterPillsValues = [];
20+
2021
public array $internalFilterPillsVals = ['name' => null];
22+
2123
public array $externalFilterPillsLength = [];
22-
public array $internalFilterPillsLength = [];
2324

25+
public array $internalFilterPillsLength = [];
2426
}

src/Traits/Filters/Helpers/FilterVisibilityHelpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Rappasoft\LaravelLivewireTables\Traits\Filters\Helpers;
44

55
use Illuminate\Support\Collection;
6-
use Rappasoft\LaravelLivewireTables\Views\Filter;
76
use Livewire\Attributes\Computed;
7+
use Rappasoft\LaravelLivewireTables\Views\Filter;
88

99
trait FilterVisibilityHelpers
1010
{
@@ -33,7 +33,7 @@ public function hasVisibleFilters(): bool
3333
#[Computed]
3434
public function showFiltersButton(): bool
3535
{
36-
return ($this->filtersAreEnabled() && $this->filtersVisibilityIsEnabled() && $this->hasVisibleFilters());
36+
return $this->filtersAreEnabled() && $this->filtersVisibilityIsEnabled() && $this->hasVisibleFilters();
3737
}
3838

3939
/**

src/Traits/Helpers/ActionsHelpers.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,18 @@
88

99
trait ActionsHelpers
1010
{
11-
1211
#[Computed]
1312
public function showActionsInToolbarLeft(): bool
1413
{
15-
return ($this->hasActions() && $this->showActionsInToolbar() && $this->getActionsPosition() === 'left');
14+
return $this->hasActions() && $this->showActionsInToolbar() && $this->getActionsPosition() === 'left';
1615
}
1716

1817
#[Computed]
1918
public function showActionsInToolbarRight(): bool
2019
{
21-
return ($this->hasActions() && $this->showActionsInToolbar() && $this->getActionsPosition() === 'right');
20+
return $this->hasActions() && $this->showActionsInToolbar() && $this->getActionsPosition() === 'right';
2221
}
2322

24-
2523
#[Computed]
2624
public function showActionsInToolbar(): bool
2725
{

src/Traits/Helpers/PaginationHelpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function getPaginationTheme(): string
3030
#[Computed]
3131
public function showPaginationDropdown(): bool
3232
{
33-
return ($this->paginationIsEnabled() && $this->perPageVisibilityIsEnabled());
33+
return $this->paginationIsEnabled() && $this->perPageVisibilityIsEnabled();
3434
}
3535

3636
#[Computed]

src/Views/Filters/LivewireComponentArrayFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ class LivewireComponentArrayFilter extends Filter
1818

1919
public function validate(array $value): array|bool
2020
{
21-
if (!$this->isEmpty($value))
22-
{
21+
if (! $this->isEmpty($value)) {
2322
return $value;
2423
}
24+
2525
return [];
2626
}
2727

src/Views/Filters/Traits/HasFilterPills.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
trait HasFilterPills
88
{
99
use HandlesFilterPillsAttributes;
10-
10+
1111
protected ?string $filterPillTitle = null;
1212

1313
protected array $filterPillValues = [];

src/Views/Filters/Traits/Styling/HandlesFilterPillsAttributes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ public function getPillAttributesBag(): ComponentAttributeBag
1515

1616
public function hasPillAttributes(): bool
1717
{
18-
return !empty($this->pillAttributes);
18+
return ! empty($this->pillAttributes);
1919
}
2020

2121
public function getPillAttributes(): array
2222
{
2323
$attributes = array_merge(['default-colors' => true, 'default-styling' => true], $this->pillAttributes);
2424
ksort($attributes);
25+
2526
return $attributes;
2627
}
2728

@@ -34,5 +35,4 @@ public function setPillAttributes(array $pillAttributes): self
3435

3536
return $this;
3637
}
37-
3838
}

0 commit comments

Comments
 (0)