Open momala454 opened 3 weeks ago
It will use @phpstan-assert
@phpstan-assert
Exemple usage
class TrueArray implements \Illuminate\Contracts\Validation\ValidationRule { public const string IDENTIFIER = 'validation.array'; /** * Indicates whether the rule should be implicit. */ public bool $implicit = true; /** * Run the validation rule. * * @param string $attribute * @param mixed $value * @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail * @return void * @phpstan-assert array $value */ public function validate(string $attribute, mixed $value, \Closure $fail): void { if (!is_array($value)) { $fail(static::IDENTIFIER)->translate(); } } }
It will use
@phpstan-assert
Exemple usage