Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use BackedEnum;
use Brick\Math\BigNumber;
use Closure;
use DateTimeInterface;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Validation\InvokableRule;
Expand Down Expand Up @@ -543,7 +544,7 @@ public static function exclude(): string
* methods if a true boolean is passed in or the passed in closure returns true.
*
* @link https://laravel.com/docs/12.x/validation#rule-exclude-if
* @param bool|callable(): bool $callback
* @param bool|Closure(): bool $callback
*/
public static function excludeIf(mixed $callback): ExcludeIf
{
Expand Down Expand Up @@ -1101,7 +1102,7 @@ public static function prohibited(): string
* passed in closure returns true.
*
* @link https://laravel.com/docs/12.x/validation#rule-prohibited-if
* @param bool|callable(): bool $callback
* @param bool|Closure(): bool $callback
*/
public static function prohibitedIf(mixed $callback): ProhibitedIf
{
Expand All @@ -1110,7 +1111,7 @@ public static function prohibitedIf(mixed $callback): ProhibitedIf

/**
* The field under validation must be empty or not present in the input data if the *anotherField* field
* is equal to "yes", "on", 1, "1", true, or "true".
* is equal to "yes", "on", 1, "1", true, or "true".
*/
public static function prohibitedIfAccepted(string $anotherField): string
{
Expand Down Expand Up @@ -1213,15 +1214,15 @@ public static function requiredArrayKeys(string ...$key): string
* closure returns true.
*
* @link https://laravel.com/docs/12.x/validation#rule-required-if
* @param bool|callable(): bool $callback
* @param bool|Closure(): bool $callback
*/
public static function requiredIf(mixed $callback): RequiredIf
{
return LaravelRule::requiredIf($callback);
}

/**
* The field under validation must be present and not empty if the *field* field is equal to "yes", "on", 1, "1",
* The field under validation must be present and not empty if the *field* field is equal to "yes", "on", 1, "1",
* true, or "true".
*
* @link https://laravel.com/docs/12.x/validation#rule-required-if-accepted
Expand Down
11 changes: 6 additions & 5 deletions src/RuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use ArrayIterator;
use BackedEnum;
use Brick\Math\BigNumber;
use Closure;
use DateTimeInterface;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Validation\Rules\Password;
Expand Down Expand Up @@ -605,7 +606,7 @@ public function exclude(): self
* methods if a true boolean is passed in or the passed in closure returns true.
*
* @link https://laravel.com/docs/12.x/validation#rule-exclude-if
* @param bool|callable(): bool $callback
* @param bool|Closure(): bool $callback
*/
public function excludeIf(mixed $callback): self
{
Expand Down Expand Up @@ -1196,7 +1197,7 @@ public function prohibited(): self
* passed in closure returns true.
*
* @link https://laravel.com/docs/12.x/validation#rule-prohibited-if
* @param bool|callable(): bool $callback
* @param bool|Closure(): bool $callback
*/
public function prohibitedIf(mixed $callback): self
{
Expand All @@ -1205,7 +1206,7 @@ public function prohibitedIf(mixed $callback): self

/**
* The field under validation must be empty or not present in the input data if the *anotherField* field
* is equal to "yes", "on", 1, "1", true, or "true".
* is equal to "yes", "on", 1, "1", true, or "true".
*/
public function prohibitedIfAccepted(string $anotherField): self
{
Expand Down Expand Up @@ -1308,15 +1309,15 @@ public function requiredArrayKeys(string ...$key): self
* closure returns true.
*
* @link https://laravel.com/docs/12.x/validation#rule-required-if
* @param bool|callable(): bool $callback
* @param bool|Closure(): bool $callback
*/
public function requiredIf(mixed $callback): self
{
return $this->rule(Rule::requiredIf($callback));
}

/**
* The field under validation must be present and not empty if the *field* field is equal to "yes", "on", 1, "1",
* The field under validation must be present and not empty if the *field* field is equal to "yes", "on", 1, "1",
* true, or "true".
*
* @link https://laravel.com/docs/12.x/validation#rule-required-if-accepted
Expand Down