55namespace Sourcetoad \RuleHelper ;
66
77use ArrayIterator ;
8+ use BackedEnum ;
89use Brick \Math \BigNumber ;
910use DateTimeInterface ;
1011use Illuminate \Contracts \Support \Arrayable ;
1112use Illuminate \Contracts \Validation \InvokableRule ;
1213use Illuminate \Contracts \Validation \Rule as RuleContract ;
1314use Illuminate \Contracts \Validation \ValidationRule ;
1415use Illuminate \Validation \ConditionalRules ;
15- use Illuminate \Validation \Rules \Dimensions ;
1616use Illuminate \Validation \Rules \Password ;
1717use Illuminate \Validation \Rules \RequiredIf ;
1818use IteratorAggregate ;
1919use Stringable ;
20+ use UnitEnum ;
2021
2122/**
2223 * @implements Arrayable<array-key, RuleContract|InvokableRule|ValidationRule|ConditionalRules|Stringable|string>
@@ -645,9 +646,9 @@ public function image(): self
645646 * list of values provided to the *in* rule.
646647 *
647648 * @link https://laravel.com/docs/11.x/validation#rule-in
648- * @param Arrayable<array-key, mixed >|array<array-key, mixed> |string $values
649+ * @param Arrayable<array-key, BackedEnum|UnitEnum|string >|array<BackedEnum|UnitEnum|string>|BackedEnum|UnitEnum |string $values
649650 */
650- public function in (Arrayable |array |string $ values ): self
651+ public function in (Arrayable |BackedEnum | UnitEnum | array |string $ values ): self
651652 {
652653 return $ this ->rule (Rule::in ($ values ));
653654 }
@@ -716,7 +717,10 @@ public function json(): self
716717 }
717718
718719 /**
719- * The field under validation must be a list style array.
720+ * The field under validation must be an array that is a list. An array is considered a list if its keys consist of
721+ * consecutive numbers from 0 to count($array) - 1.
722+ *
723+ * @link https://laravel.com/docs/11.x/validation#rule-list
720724 */
721725 public function list (): self
722726 {
@@ -888,9 +892,9 @@ public function multipleOf(int|float $value): self
888892 * The field under validation must not be included in the given list of values.
889893 *
890894 * @link https://laravel.com/docs/11.x/validation#rule-not-in
891- * @param Arrayable<array-key, mixed >|array<array-key, mixed> |string $values
895+ * @param Arrayable<array-key, BackedEnum|UnitEnum|string >|array<BackedEnum|UnitEnum|string>|BackedEnum|UnitEnum |string $values
892896 */
893- public function notIn (Arrayable |array |string $ values ): self
897+ public function notIn (Arrayable |BackedEnum | UnitEnum | array |string $ values ): self
894898 {
895899 return $ this ->rule (Rule::notIn ($ values ));
896900 }
@@ -958,35 +962,39 @@ public function present(): self
958962 }
959963
960964 /**
961- * The field under validation must be present but can be empty if *anotherField* under validation is equal to a
962- * specified value.
965+ * The field under validation must be present if the *anotherField* field is equal to any *value*.
966+ *
967+ * @link https://laravel.com/docs/11.x/validation#rule-present-if
963968 */
964969 public function presentIf (string $ anotherField , string ...$ value ): self
965970 {
966971 return $ this ->rule (Rule::presentIf ($ anotherField , ...$ value ));
967972 }
968973
969974 /**
970- * The field under validation must be present but can be empty unless the *anotherField* field is equal to any
971- * *value*.
975+ * The field under validation must be present unless the *anotherField* field is equal to any *value*.
976+ *
977+ * @link https://laravel.com/docs/11.x/validation#rule-present-unless
972978 */
973979 public function presentUnless (string $ anotherField , string ...$ value ): self
974980 {
975981 return $ this ->rule (Rule::presentUnless ($ anotherField , ...$ value ));
976982 }
977983
978984 /**
979- * The field under validation must be present but can be empty *only if* any of the other specified fields are
980- * present and not empty.
985+ * The field under validation must be present *only if* any of the other specified fields are present.
986+ *
987+ * @link https://laravel.com/docs/11.x/validation#rule-present-with
981988 */
982989 public function presentWith (string ...$ field ): self
983990 {
984991 return $ this ->rule (Rule::presentWith (...$ field ));
985992 }
986993
987994 /**
988- * The field under validation must be present but can be empty *only if* all the other specified fields are present
989- * and not empty.
995+ * The field under validation must be present *only if* all the other specified fields are present.
996+ *
997+ * @link https://laravel.com/docs/11.x/validation#rule-present-with-all
990998 */
991999 public function presentWithAll (string ...$ field ): self
9921000 {
@@ -1088,7 +1096,7 @@ public function requiredIf(mixed $callback): self
10881096 }
10891097
10901098 /**
1091- * The field under validation must be present and not empty if the ` field` field is equal to yes, on, 1, "1", true,
1099+ * The field under validation must be present and not empty if the * field* field is equal to yes, on, 1, "1", true,
10921100 * or "true".
10931101 *
10941102 * @link https://laravel.com/docs/11.x/validation#rule-required-if-accepted
@@ -1115,7 +1123,7 @@ public function requiredIfAny(RequiredIf ...$rules): self
11151123 }
11161124
11171125 /**
1118- * The field under validation must be present and not empty if the ` field` field is equal to "no", "off", 0, "0",
1126+ * The field under validation must be present and not empty if the * field* field is equal to "no", "off", 0, "0",
11191127 * false, or "false".
11201128 *
11211129 * @link https://laravel.com/docs/11.x/validation#rule-required-if-declined
0 commit comments