Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 0a03168

Browse files
committed
chore: added Url rule to interfaces
1 parent e77ca21 commit 0a03168

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/ChainedValidatorInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,11 @@ public function type(
8484
string|array $constraint,
8585
string $message = 'The {{ name }} value should be of type {{ constraint }}, {{ value }} given.'
8686
): ChainedValidatorInterface&Validator;
87+
88+
public function url(
89+
array $protocols = ['http', 'https'],
90+
bool $allowRelativeProtocol = false,
91+
?callable $normalizer = null,
92+
string $message = 'The {{ name }} value is not a valid URL address, {{ value }} given.'
93+
): ChainedValidatorInterface&Validator;
8794
}

src/StaticValidatorInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,11 @@ public static function type(
8383
string|array $constraint,
8484
string $message = 'The {{ name }} value should be of type {{ constraint }}, {{ value }} given.'
8585
): ChainedValidatorInterface&Validator;
86+
87+
public static function url(
88+
array $protocols = ['http', 'https'],
89+
bool $allowRelativeProtocol = false,
90+
?callable $normalizer = null,
91+
string $message = 'The {{ name }} value is not a valid URL address, {{ value }} given.'
92+
): ChainedValidatorInterface&Validator;
8693
}

0 commit comments

Comments
 (0)