diff --git a/src/Components/Rules/BaseRule.php b/src/Components/Rules/BaseRule.php index 5b7cae86..5b411fc8 100644 --- a/src/Components/Rules/BaseRule.php +++ b/src/Components/Rules/BaseRule.php @@ -17,7 +17,7 @@ class BaseRule implements Wireable, ConditionalRule public string $forAction = ''; - public ?string $column = ''; + public string $column = ''; private bool $hasCondition = false; @@ -69,14 +69,14 @@ public static function fromLivewire($value) return $value; } - public function when(Closure $closure = null): self + public function when(Closure $closure): self { $this->setCondition('when', $closure); return $this; } - public function unless(Closure $closure = null): self + public function unless(Closure $closure): self { $this->setCondition('unless', $closure); diff --git a/src/Components/Rules/RuleEditOnClick.php b/src/Components/Rules/RuleEditOnClick.php index ffb04a77..1172f984 100644 --- a/src/Components/Rules/RuleEditOnClick.php +++ b/src/Components/Rules/RuleEditOnClick.php @@ -6,7 +6,7 @@ class RuleEditOnClick extends BaseRule { public string $forAction = RuleManager::TYPE_EDIT_ON_CLICK; - public function __construct(public string|null $column) + public function __construct(public string $column) { $this->forAction = $column; } diff --git a/src/Components/Rules/RuleRows.php b/src/Components/Rules/RuleRows.php index 9bf041bc..79fc0b1a 100644 --- a/src/Components/Rules/RuleRows.php +++ b/src/Components/Rules/RuleRows.php @@ -96,7 +96,7 @@ public function hideToggleDetail(): self /** * Interacts with Blade loop. */ - public function loop(Closure $closure = null): self + public function loop(Closure $closure): self { $this->setCondition('loop', $closure); diff --git a/src/Components/Rules/RuleToggleable.php b/src/Components/Rules/RuleToggleable.php index abd492e7..b6c145e3 100644 --- a/src/Components/Rules/RuleToggleable.php +++ b/src/Components/Rules/RuleToggleable.php @@ -6,7 +6,7 @@ class RuleToggleable extends BaseRule { public string $forAction = RuleManager::TYPE_TOGGLEABLE; - public function __construct(public string|null $column) + public function __construct(public string $column) { $this->forAction = $column; } diff --git a/src/Components/Rules/RulesController.php b/src/Components/Rules/RulesController.php index c8fbf8b1..01e5f2b6 100644 --- a/src/Components/Rules/RulesController.php +++ b/src/Components/Rules/RulesController.php @@ -106,7 +106,7 @@ public function recoverActionForField(Model|\stdClass|array $row, string $reques } }); - return $rules->toArray() ?? []; + return $rules->toArray(); } public function loop(array $actionRules, object|int $loop): bool diff --git a/src/Contracts/ConditionalRule.php b/src/Contracts/ConditionalRule.php index 20003130..ba025834 100644 --- a/src/Contracts/ConditionalRule.php +++ b/src/Contracts/ConditionalRule.php @@ -14,9 +14,9 @@ public function setModifier(string $modifier, mixed $arguments): void; public function pushModifier(string $modifier, array $argument): void; - public function when(Closure $closure = null): self; + public function when(Closure $closure): self; - public function unless(Closure $closure = null): self; + public function unless(Closure $closure): self; public function toLivewire(): array;