Skip to content

Commit 3ae1b02

Browse files
committed
chore: add return type docblocks to validator
1 parent e679026 commit 3ae1b02

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/validation/src/Validator.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function createValidationFailureException(array $failingRules, null|objec
6969
* Validates the specified `$values` for the corresponding public properties on the specified `$class`, using built-in PHP types and attribute rules.
7070
*
7171
* @param ClassReflector|class-string $class
72+
* @return Rule[]
7273
*/
7374
public function validateValuesForClass(ClassReflector|string $class, ?array $values, string $prefix = ''): array
7475
{
@@ -118,6 +119,8 @@ class: $property->getType()->asClass(),
118119

119120
/**
120121
* Validates `$value` against the specified `$property`, using built-in PHP types and attribute rules.
122+
*
123+
* @return Rule[]
121124
*/
122125
public function validateValueForProperty(PropertyReflector $property, mixed $value): array
123126
{
@@ -147,8 +150,7 @@ public function validateValueForProperty(PropertyReflector $property, mixed $val
147150
* Validates the specified `$value` against the specified set of `$rules`. If a rule is a closure, it may return a string as a validation error.
148151
*
149152
* @param Rule|array<Rule|(Closure(mixed $value):string|false)>|(Closure(mixed $value):string|false) $rules
150-
*
151-
* @return array<Rule>
153+
* @return Rule[]
152154
*/
153155
public function validateValue(mixed $value, Closure|Rule|array $rules): array
154156
{
@@ -176,6 +178,8 @@ public function validateValue(mixed $value, Closure|Rule|array $rules): array
176178
*
177179
* @param array<string,mixed> $values
178180
* @param array<string,Rule|(Closure(mixed $value):string|false)> $rules
181+
*
182+
* @return Rule[]
179183
*/
180184
public function validateValues(iterable $values, array $rules): array
181185
{

0 commit comments

Comments
 (0)