File tree 3 files changed +7
-4
lines changed
Filter options
src/Symfony/Component/Validator/Constraints 3 files changed +7
-4
lines changed
Original file line number Diff line number Diff line change 14
14
use Symfony \Component \Validator \Constraint ;
15
15
use Symfony \Component \Validator \ConstraintValidator ;
16
16
use Symfony \Component \Validator \Exception \ConstraintDefinitionException ;
17
+ use Symfony \Component \Validator \Exception \RuntimeException ;
17
18
use Symfony \Component \Validator \Exception \UnexpectedTypeException ;
18
19
use Symfony \Component \Validator \Exception \UnexpectedValueException ;
19
20
@@ -57,7 +58,7 @@ public function validate(mixed $value, Constraint $constraint)
57
58
}
58
59
59
60
if (true !== $ constraint ->strict ) {
60
- throw new \ RuntimeException ('The "strict" option of the Choice constraint should not be used. ' );
61
+ throw new RuntimeException ('The "strict" option of the Choice constraint should not be used. ' );
61
62
}
62
63
63
64
if ($ constraint ->multiple ) {
Original file line number Diff line number Diff line change 16
16
use Egulias \EmailValidator \Validation \NoRFCWarningsValidation ;
17
17
use Symfony \Component \Validator \Constraint ;
18
18
use Symfony \Component \Validator \ConstraintValidator ;
19
+ use Symfony \Component \Validator \Exception \InvalidArgumentException ;
19
20
use Symfony \Component \Validator \Exception \UnexpectedTypeException ;
20
21
use Symfony \Component \Validator \Exception \UnexpectedValueException ;
21
22
@@ -39,7 +40,7 @@ class EmailValidator extends ConstraintValidator
39
40
public function __construct (string $ defaultMode = Email::VALIDATION_MODE_LOOSE )
40
41
{
41
42
if (!\in_array ($ defaultMode , Email::VALIDATION_MODES , true )) {
42
- throw new \ InvalidArgumentException ('The "defaultMode" parameter value is not valid. ' );
43
+ throw new InvalidArgumentException ('The "defaultMode" parameter value is not valid. ' );
43
44
}
44
45
45
46
if (Email::VALIDATION_MODE_LOOSE === $ defaultMode ) {
@@ -81,7 +82,7 @@ public function validate(mixed $value, Constraint $constraint)
81
82
}
82
83
83
84
if (!\in_array ($ constraint ->mode , Email::VALIDATION_MODES , true )) {
84
- throw new \ InvalidArgumentException (sprintf ('The "%s::$mode" parameter value is not valid. ' , get_debug_type ($ constraint )));
85
+ throw new InvalidArgumentException (sprintf ('The "%s::$mode" parameter value is not valid. ' , get_debug_type ($ constraint )));
85
86
}
86
87
87
88
if (Email::VALIDATION_MODE_STRICT === $ constraint ->mode ) {
Original file line number Diff line number Diff line change 14
14
use Symfony \Component \HttpClient \HttpClient ;
15
15
use Symfony \Component \Validator \Constraint ;
16
16
use Symfony \Component \Validator \ConstraintValidator ;
17
+ use Symfony \Component \Validator \Exception \LogicException ;
17
18
use Symfony \Component \Validator \Exception \UnexpectedTypeException ;
18
19
use Symfony \Component \Validator \Exception \UnexpectedValueException ;
19
20
use Symfony \Contracts \HttpClient \Exception \ExceptionInterface ;
@@ -39,7 +40,7 @@ class NotCompromisedPasswordValidator extends ConstraintValidator
39
40
public function __construct (HttpClientInterface $ httpClient = null , string $ charset = 'UTF-8 ' , bool $ enabled = true , string $ endpoint = null )
40
41
{
41
42
if (null === $ httpClient && !class_exists (HttpClient::class)) {
42
- throw new \ LogicException (sprintf ('The "%s" class requires the "HttpClient" component. Try running "composer require symfony/http-client". ' , self ::class));
43
+ throw new LogicException (sprintf ('The "%s" class requires the "HttpClient" component. Try running "composer require symfony/http-client". ' , self ::class));
43
44
}
44
45
45
46
$ this ->httpClient = $ httpClient ?? HttpClient::create ();
You can’t perform that action at this time.
0 commit comments