Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
dansysanalyst committed May 19, 2024
1 parent 6d6d7b8 commit c933120
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/Components/Rules/BaseRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class BaseRule implements Wireable, ConditionalRule

public string $forAction = '';

public ?string $column = '';
public string $column = '';

private bool $hasCondition = false;

Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/Components/Rules/RuleEditOnClick.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Rules/RuleRows.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/Components/Rules/RuleToggleable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Rules/RulesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Contracts/ConditionalRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c933120

Please sign in to comment.