prefix
stringlengths
512
512
suffix
stringlengths
256
256
middle
stringlengths
14
229
meta
dict
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; /** * A sequence of validation groups. * * When validating a group sequence, e...
, if "Strict" * contains expensive checks that require a lot of CPU or slow, external * services. You usually don't want to run expensive checks if any of the cheap * checks fail. * * When adding metadata to a class, you can override the "Default" gro
; * * In the first step, all constraints that belong to the group "Basic" will be * validated. If none of the constraints fail, the validator will then validate * the constraints in group "Strict". This is useful, for example
{ "filepath": "src/Symfony/Component/Validator/Constraints/GroupSequence.php", "language": "php", "file_size": 2597, "cut_index": 563, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony...
self::INVALID_HOSTNAME_ERROR => 'INVALID_HOSTNAME_ERROR', ]; public string $message = 'This value is not a valid hostname.'; public bool $requireTld = true; /** * @param bool|null $requireTld Whether to require the hostn
:TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Hostname extends Constraint { public const INVALID_HOSTNAME_ERROR = '7057ffdb-0af4-4f7e-bd5e-e9acfa6d7a2d'; protected const ERROR_NAMES = [
{ "filepath": "src/Symfony/Component/Validator/Constraints/Hostname.php", "language": "php", "file_size": 1706, "cut_index": 537, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Const...
'test', ]; public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Hostname) { throw new UnexpectedTypeException($constraint, Hostname::class); } if (null =
bny@gmail.com> */ class HostnameValidator extends ConstraintValidator { /** * https://tools.ietf.org/html/rfc2606. */ private const RESERVED_TLDS = [ 'example', 'invalid', 'localhost',
{ "filepath": "src/Symfony/Component/Validator/Constraints/HostnameValidator.php", "language": "php", "file_size": 2052, "cut_index": 563, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Excep...
BLE)] class Iban extends Constraint { public const INVALID_COUNTRY_CODE_ERROR = 'de78ee2c-bd50-44e2-aec8-3d8228aeadb9'; public const INVALID_CHARACTERS_ERROR = '8d3d85e4-784f-4719-a5bc-d9e40d45a3a5'; public const CHECKSUM_FAILED_ERROR = 'b94013
umber * * @author Manuel Reinhard <manu@sprain.ch> * @author Michael Schummel * @author Bernhard Schussek <bschussek@gmail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATA
{ "filepath": "src/Symfony/Component/Validator/Constraints/Iban.php", "language": "php", "file_size": 2255, "cut_index": 563, "middle_length": 229 }
Validator\Exception\UnexpectedTypeException; use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @author Manuel Reinhard <manu@sprain.ch> * @author Michael Schummel * @author Bernhard Schussek <bschussek@gmail.com> */ class IbanValidator extends ConstraintValidator { /** * IBAN count...
h a fixed position and a fixed length per country * * @see Resources/bin/sync-iban-formats.php * @see https://www.swift.com/swift-resource/11971/download?language=en * @see https://en.wikipedia.org/wiki/International_Bank_Account_Number
om the rest of the IBAN characters. * The rest are up to thirty alphanumeric characters for * a BBAN (Basic Bank Account Number) which has a fixed length per country and, * included within it, a bank identifier wit
{ "filepath": "src/Symfony/Component/Validator/Constraints/IbanValidator.php", "language": "php", "file_size": 13286, "cut_index": 921, "middle_length": 229 }
he Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; /** * Validates that a value is identical to another value. * ...
ison { public const NOT_IDENTICAL_ERROR = '2a8cc50f-58a2-4536-875e-060a2ce69ed5'; protected const ERROR_NAMES = [ self::NOT_IDENTICAL_ERROR => 'NOT_IDENTICAL_ERROR', ]; public string $message = 'This value should be identical to {
EPEATABLE)] class IdenticalTo extends AbstractCompar
{ "filepath": "src/Symfony/Component/Validator/Constraints/IdenticalTo.php", "language": "php", "file_size": 906, "cut_index": 547, "middle_length": 52 }
is a valid image. * * @author Benjamin Dulau <benjamin.dulau@gmail.com> * @author Bernhard Schussek <bschussek@gmail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Image extends File { public const SIZE_NOT_DETECTED_ERROR = '6d55c3f4-e58e-4fe3-9...
PIXEL_ERROR = 'ee0804e8-44db-4eac-9775-be91aaf72ce1'; public const RATIO_TOO_BIG_ERROR = '70cafca6-168f-41c9-8c8c-4e47a52be643'; public const RATIO_TOO_SMALL_ERROR = '59b8c6ef-bcf2-4ceb-afff-4642ed92f12e'; public const SQUARE_NOT_ALLOWED_ERROR
GH_ERROR = '7efae81c-4877-47ba-aa65-d01ccb0d4645'; public const TOO_LOW_ERROR = 'aef0cb6a-c07f-4894-bc08-1781420d7b4c'; public const TOO_FEW_PIXEL_ERROR = '1b06b97d-ae48-474e-978f-038a74854c43'; public const TOO_MANY_
{ "filepath": "src/Symfony/Component/Validator/Constraints/Image.php", "language": "php", "file_size": 13547, "cut_index": 921, "middle_length": 229 }
onstraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Exception\LogicException; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** * Validates whether a value is a valid image file and is valid * against minWidth, maxWidth, minHeight a...
this->context->getViolations()); parent::validate($value, $constraint); $failed = \count($this->context->getViolations()) !== $violations; if ($failed || null === $value || '' === $value) { return; }
function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Image) { throw new UnexpectedTypeException($constraint, Image::class); } $violations = \count($
{ "filepath": "src/Symfony/Component/Validator/Constraints/ImageValidator.php", "language": "php", "file_size": 11303, "cut_index": 921, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Com...
t V6 = '6'; public const ALL = 'all'; // adds inverse FILTER_FLAG_NO_RES_RANGE and FILTER_FLAG_NO_PRIV_RANGE flags (skip both) public const V4_NO_PUBLIC = '4_no_public'; public const V6_NO_PUBLIC = '6_no_public'; public const ALL_NO_PU
loyd@gmail.com> * @author Ninos Ego <me@ninosego.de> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Ip extends Constraint { public const V4 = '4'; public cons
{ "filepath": "src/Symfony/Component/Validator/Constraints/Ip.php", "language": "php", "file_size": 4839, "cut_index": 614, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exc...
rnal */ public static function checkIp(string $ip, mixed $version): bool { $flag = match ($version) { Ip::V4, Ip::V4_NO_PUBLIC, Ip::V4_ONLY_PRIVATE, Ip::V4_ONLY_RESERVED => \FILTER_FLAG_IPV4, Ip::V6, Ip::V6_NO_P
chussek@gmail.com> * @author Joseph Bielawski <stloyd@gmail.com> * @author Ninos Ego <me@ninosego.de> */ class IpValidator extends ConstraintValidator { /** * Checks whether an IP address is valid. * * @inte
{ "filepath": "src/Symfony/Component/Validator/Constraints/IpValidator.php", "language": "php", "file_size": 3507, "cut_index": 614, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint...
self::NOT_FALSE_ERROR => 'NOT_FALSE_ERROR', ]; public string $message = 'This value should be false.'; /** * @param string[]|null $groups */ public function __construct(?array $options = null, ?string $message = null, ?array $
::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class IsFalse extends Constraint { public const NOT_FALSE_ERROR = 'd53a91b0-def3-426a-83d7-269da7ab4200'; protected const ERROR_NAMES = [
{ "filepath": "src/Symfony/Component/Validator/Constraints/IsFalse.php", "language": "php", "file_size": 1374, "cut_index": 524, "middle_length": 229 }
hp /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\C...
traint, IsFalse::class); } if (null === $value || false === $value || 0 === $value || '0' === $value) { return; } $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $
lass IsFalseValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof IsFalse) { throw new UnexpectedTypeException($cons
{ "filepath": "src/Symfony/Component/Validator/Constraints/IsFalseValidator.php", "language": "php", "file_size": 1113, "cut_index": 515, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint...
MES = [ self::NOT_NULL_ERROR => 'NOT_NULL_ERROR', ]; public string $message = 'This value should be null.'; /** * @param string[]|null $groups */ public function __construct(?array $options = null, ?string $message = nul
ibute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class IsNull extends Constraint { public const NOT_NULL_ERROR = '60d2f30b-8cfa-4372-b155-9656634de120'; protected const ERROR_NA
{ "filepath": "src/Symfony/Component/Validator/Constraints/IsNull.php", "language": "php", "file_size": 1385, "cut_index": 524, "middle_length": 229 }
?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator...
traint, IsNull::class); } if (null !== $value) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode(IsNull::NOT_NULL_ERROR)
class IsNullValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof IsNull) { throw new UnexpectedTypeException($cons
{ "filepath": "src/Symfony/Component/Validator/Constraints/IsNullValidator.php", "language": "php", "file_size": 1049, "cut_index": 513, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint...
elf::NOT_TRUE_ERROR => 'NOT_TRUE_ERROR', ]; public string $message = 'This value should be true.'; /** * @param string[]|null $groups */ public function __construct(?array $options = null, ?string $message = null, ?array $groups
:TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class IsTrue extends Constraint { public const NOT_TRUE_ERROR = '2beabf1c-54c0-4882-a928-05249b26e23b'; protected const ERROR_NAMES = [ s
{ "filepath": "src/Symfony/Component/Validator/Constraints/IsTrue.php", "language": "php", "file_size": 1368, "cut_index": 524, "middle_length": 229 }
hp /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\C...
aint, IsTrue::class); } if (null === $value || true === $value || 1 === $value || '1' === $value) { return; } $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this
lass IsTrueValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof IsTrue) { throw new UnexpectedTypeException($constr
{ "filepath": "src/Symfony/Component/Validator/Constraints/IsTrueValidator.php", "language": "php", "file_size": 1107, "cut_index": 515, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; /** * Validates that a value is a v...
= 'isbn10'; public const ISBN_13 = 'isbn13'; public const TOO_SHORT_ERROR = '949acbb0-8ef5-43ed-a0e9-032dfd08ae45'; public const TOO_LONG_ERROR = '3171387d-f80a-47b3-bd6e-60598545316a'; public const INVALID_CHARACTERS_ERROR = '23d21cea-da
d <manu@sprain.ch> * @author Bernhard Schussek <bschussek@gmail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Isbn extends Constraint { public const ISBN_10
{ "filepath": "src/Symfony/Component/Validator/Constraints/Isbn.php", "language": "php", "file_size": 2853, "cut_index": 563, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component\Validator\Exception\UnexpectedValueException; /...
!$constraint instanceof Isbn) { throw new UnexpectedTypeException($constraint, Isbn::class); } if (null === $value || '' === $value) { return; } if (!\is_scalar($value) && !$value instanceof \String
rnhard Schussek <bschussek@gmail.com> * * @see https://en.wikipedia.org/wiki/Isbn */ class IsbnValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (
{ "filepath": "src/Symfony/Component/Validator/Constraints/IsbnValidator.php", "language": "php", "file_size": 5561, "cut_index": 716, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony...
straint { public const VALIDATION_LENGTH = 12; public const VALIDATION_PATTERN = '/[A-Z]{2}[A-Z0-9]{9}[0-9]{1}/'; public const INVALID_LENGTH_ERROR = '88738dfc-9ed5-ba1e-aebe-402a2a9bf58e'; public const INVALID_PATTERN_ERROR = '3d08ce0-ded
ki/International_Securities_Identification_Number * * @author Laurent Masforné <l.masforne@gmail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Isin extends Con
{ "filepath": "src/Symfony/Component/Validator/Constraints/Isin.php", "language": "php", "file_size": 1990, "cut_index": 537, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Const...
{ if (!$constraint instanceof Isin) { throw new UnexpectedTypeException($constraint, Isin::class); } if (null === $value || '' === $value) { return; } if (!\is_scalar($value) && !$value
rne@gmail.com> * * @see https://en.wikipedia.org/wiki/International_Securities_Identification_Number */ class IsinValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void
{ "filepath": "src/Symfony/Component/Validator/Constraints/IsinValidator.php", "language": "php", "file_size": 2485, "cut_index": 563, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint...
RROR => 'BAD_ENCODING_ERROR', ]; public function __construct( public array|string $encodings = [], public string $message = 'The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}.',
:TARGET_METHOD | \Attribute::IS_REPEATABLE)] final class Charset extends Constraint { public const BAD_ENCODING_ERROR = '94c5e58b-f892-4e25-8fd6-9d89c80bfe81'; protected const ERROR_NAMES = [ self::BAD_ENCODING_E
{ "filepath": "src/Symfony/Component/Validator/Constraints/Charset.php", "language": "php", "file_size": 1320, "cut_index": 524, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony...
) { throw new UnexpectedTypeException($constraint, Charset::class); } if (null === $value) { return; } if (!\is_string($value) && !$value instanceof \Stringable) { throw new UnexpectedVa
Alexandre Daubois <alex.daubois@gmail.com> */ final class CharsetValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Charset
{ "filepath": "src/Symfony/Component/Validator/Constraints/CharsetValidator.php", "language": "php", "file_size": 1547, "cut_index": 537, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exc...
g> * @author Bernhard Schussek <bschussek@gmail.com> */ class ChoiceValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Choice) { throw new
ator\Exception\UnexpectedValueException; /** * ChoiceValidator validates that the value is one of the expected values. * * @author Fabien Potencier <fabien@symfony.com> * @author Florian Eckerstorfer <florian@eckerstorfer.or
{ "filepath": "src/Symfony/Component/Validator/Constraints/ChoiceValidator.php", "language": "php", "file_size": 4410, "cut_index": 614, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Const...
value, Constraint $constraint): void { if (!$constraint instanceof Cidr) { throw new UnexpectedTypeException($constraint, Cidr::class); } if (null === $value || '' === $value) { return; }
DR notation. * * @author Sorin Pop <popsorin15@gmail.com> * @author Calin Bolea <calin.bolea@gmail.com> * @author Ninos Ego <me@ninosego.de> */ class CidrValidator extends ConstraintValidator { public function validate($
{ "filepath": "src/Symfony/Component/Validator/Constraints/CidrValidator.php", "language": "php", "file_size": 2654, "cut_index": 563, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Exception\InvalidArgumentException; /** * A constraint that is composed of other co...
act class Composite extends Constraint { /** * The groups of the composite and its nested constraints are made * consistent using the following strategy: * * - If groups are passed explicitly to the composite constraint, but
te your own composite constraint, extend this class and * let {@link getCompositeOption()} return the name of the property which * contains the nested constraints. * * @author Bernhard Schussek <bschussek@gmail.com> */ abstr
{ "filepath": "src/Symfony/Component/Validator/Constraints/Composite.php", "language": "php", "file_size": 6185, "cut_index": 716, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; /** * Extend this ...
f('Passing an array of options to configure the "%s" constraint is no longer supported.', static::class)); } $this->constraints = $this->getConstraints([]); if (null !== $groups) { // reset nested groups so that Compos
public array $constraints = []; public function __construct(mixed $options = null, ?array $groups = null, mixed $payload = null) { if (null !== $options) { throw new InvalidArgumentException(\sprint
{ "filepath": "src/Symfony/Component/Validator/Constraints/Compound.php", "language": "php", "file_size": 3069, "cut_index": 614, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\MissingOptionsException; /** * Validates a c...
ece-a0e1-473fc02dadbc'; public const NOT_DIVISIBLE_BY_ERROR = DivisibleBy::NOT_DIVISIBLE_BY; protected const ERROR_NAMES = [ self::TOO_FEW_ERROR => 'TOO_FEW_ERROR', self::TOO_MANY_ERROR => 'TOO_MANY_ERROR', self::NOT_EQUAL_
unt extends Constraint { public const TOO_FEW_ERROR = 'bef8e338-6ae5-4caf-b8e2-50e7b0579e69'; public const TOO_MANY_ERROR = '756b1212-697c-468d-a9ad-50dd783bb169'; public const NOT_EQUAL_COUNT_ERROR = '9fe5d43f-3784-4
{ "filepath": "src/Symfony/Component/Validator/Constraints/Count.php", "language": "php", "file_size": 3517, "cut_index": 614, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Intl\Countries; use Symfony\Component\Validator\Constraint;...
lass Country extends Constraint { public const NO_SUCH_COUNTRY_ERROR = '8f900c12-61bd-455d-9398-996cd040f7f0'; protected const ERROR_NAMES = [ self::NO_SUCH_COUNTRY_ERROR => 'NO_SUCH_COUNTRY_ERROR', ]; public string $message = 'Th
ode. * * @see https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes * * @author Bernhard Schussek <bschussek@gmail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] c
{ "filepath": "src/Symfony/Component/Validator/Constraints/Country.php", "language": "php", "file_size": 2136, "cut_index": 563, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component\Validator\Exception\UnexpectedValueException; /...
.org/wiki/CSS/Properties/color/keywords#Basic_Colors private const PATTERN_BASIC_NAMED_COLORS = '/^(black|silver|gray|white|maroon|red|purple|fuchsia|green|lime|olive|yellow|navy|blue|teal|aqua)$/iD'; // List comes from https://www.w3.org/wiki/CSS/
te const PATTERN_HEX_LONG_WITH_ALPHA = '/^#[0-9a-f]{8}$/iD'; private const PATTERN_HEX_SHORT = '/^#[0-9a-f]{3}$/iD'; private const PATTERN_HEX_SHORT_WITH_ALPHA = '/^#[0-9a-f]{4}$/iD'; // List comes from https://www.w3
{ "filepath": "src/Symfony/Component/Validator/Constraints/CssColorValidator.php", "language": "php", "file_size": 5528, "cut_index": 716, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Intl\Currencies; use Symfony\Comp...
ROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Currency extends Constraint { public const NO_SUCH_CURRENCY_ERROR = '69945ac1-2db4-405f-bec7-d2772f73df52'; protected const ERROR_NAMES = [ self::NO_SUCH_CURRENCY_ERRO
lid 3-letter ISO 4217 currency name. * * @see https://en.wikipedia.org/wiki/ISO_4217 * * @author Miha Vrhovnik <miha.vrhovnik@pagein.si> * @author Bernhard Schussek <bschussek@gmail.com> */ #[\Attribute(\Attribute::TARGET_P
{ "filepath": "src/Symfony/Component/Validator/Constraints/Currency.php", "language": "php", "file_size": 1844, "cut_index": 537, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; /** * Val...
INVALID_DATE_ERROR = 'd52afa47-620d-4d99-9f08-f4d85b36e33c'; public const INVALID_TIME_ERROR = '5e797c9d-74f7-4098-baa3-94390c447b27'; protected const ERROR_NAMES = [ self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', self::INV
\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class DateTime extends Constraint { public const INVALID_FORMAT_ERROR = '1a9da513-2640-4f84-9b6a-4d99dcddc628'; public const
{ "filepath": "src/Symfony/Component/Validator/Constraints/DateTime.php", "language": "php", "file_size": 1701, "cut_index": 537, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint...
RGET_CLASS)] class DisableAutoMapping extends Constraint { public function __construct(?array $options = null, mixed $payload = null) { if (null !== $options) { throw new InvalidArgumentException(\sprintf('Passing an array of op
which has higher precedence than any configuration that might be defined outside the class. * * @author Kévin Dunglas <dunglas@gmail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TA
{ "filepath": "src/Symfony/Component/Validator/Constraints/DisableAutoMapping.php", "language": "php", "file_size": 1290, "cut_index": 524, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component...
} if (null === $value || '' === $value) { return; } if (!\is_scalar($value) && !$value instanceof \Stringable) { throw new UnexpectedValueException($value, 'string'); } $value = (string) $
s DateValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof DateTime) { throw new UnexpectedTypeException($constraint, DateTime::class);
{ "filepath": "src/Symfony/Component/Validator/Constraints/DateTimeValidator.php", "language": "php", "file_size": 3111, "cut_index": 614, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Exception\UnexpectedVal...
e2)) { throw new UnexpectedValueException($value2, 'numeric'); } if (!$value2 = abs($value2)) { return false; } if (\is_int($value1 = abs($value1)) && \is_int($value2)) { return 0 === ($v
tor { protected function compareValues(mixed $value1, mixed $value2): bool { if (!is_numeric($value1)) { throw new UnexpectedValueException($value1, 'numeric'); } if (!is_numeric($valu
{ "filepath": "src/Symfony/Component/Validator/Constraints/DivisibleByValidator.php", "language": "php", "file_size": 1559, "cut_index": 537, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint...
GET_CLASS)] class EnableAutoMapping extends Constraint { public function __construct(?array $options = null, mixed $payload = null) { if (null !== $options) { throw new InvalidArgumentException(\sprintf('Passing an array of opti
hich has higher precedence than any configuration that might be defined outside the class. * * @author Kévin Dunglas <dunglas@gmail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TAR
{ "filepath": "src/Symfony/Component/Validator/Constraints/EnableAutoMapping.php", "language": "php", "file_size": 1288, "cut_index": 524, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** * Validates that a card number belongs to a specified scheme. *...
> [ '/^3[47][0-9]{13}$/D', ], // China UnionPay cards start with 62 and have between 16 and 19 digits. // Please note that these cards do not follow Luhn Algorithm as a checksum. CardScheme::CHINA_UNIONPAY => [
essions.info/creditcard.html */ class CardSchemeValidator extends ConstraintValidator { protected array $schemes = [ // American Express card numbers start with 34 or 37 and have 15 digits. CardScheme::AMEX =
{ "filepath": "src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php", "language": "php", "file_size": 5120, "cut_index": 716, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; /** * Validates th...
ERROR = '9bd98e49-211c-433f-8630-fd1c2d0f08c3'; protected const ERROR_NAMES = [ self::NO_SUCH_CHOICE_ERROR => 'NO_SUCH_CHOICE_ERROR', self::TOO_FEW_ERROR => 'TOO_FEW_ERROR', self::TOO_MANY_ERROR => 'TOO_MANY_ERROR', ];
IS_REPEATABLE)] class Choice extends Constraint { public const NO_SUCH_CHOICE_ERROR = '8e179f1b-97aa-4560-a02f-2a8b42e49df7'; public const TOO_FEW_ERROR = '11edd7eb-5872-4b6e-9f12-89923999fd0e'; public const TOO_MANY_
{ "filepath": "src/Symfony/Component/Validator/Constraints/Choice.php", "language": "php", "file_size": 3908, "cut_index": 614, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\MissingOptionsException; /** * Validates a c...
const ERROR_NAMES = [ self::MISSING_FIELD_ERROR => 'MISSING_FIELD_ERROR', self::NO_SUCH_FIELD_ERROR => 'NO_SUCH_FIELD_ERROR', ]; public array $fields = []; public bool $allowExtraFields = false; public bool $allowMissingFie
e::IS_REPEATABLE)] class Collection extends Composite { public const MISSING_FIELD_ERROR = '2fa2158c-2a7f-484b-98aa-975522539ff8'; public const NO_SUCH_FIELD_ERROR = '7703c766-b5d5-4cef-ace7-ae0dd82304e9'; protected
{ "filepath": "src/Symfony/Component/Validator/Constraints/Collection.php", "language": "php", "file_size": 3456, "cut_index": 614, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exc...
); } if (null === $value) { return; } if (!\is_array($value) && !($value instanceof \Traversable && $value instanceof \ArrayAccess)) { throw new UnexpectedValueException($value, 'array|(Traversable&
s ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Collection) { throw new UnexpectedTypeException($constraint, Collection::class
{ "filepath": "src/Symfony/Component/Validator/Constraints/CollectionValidator.php", "language": "php", "file_size": 3419, "cut_index": 614, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Intl\Countries; use Symfony\Compo...
value, Constraint $constraint): void { if (!$constraint instanceof Country) { throw new UnexpectedTypeException($constraint, Country::class); } if (null === $value || '' === $value) { return; }
xpectedValueException; /** * Validates whether a value is a valid country code. * * @author Bernhard Schussek <bschussek@gmail.com> */ class CountryValidator extends ConstraintValidator { public function validate(mixed $
{ "filepath": "src/Symfony/Component/Validator/Constraints/CountryValidator.php", "language": "php", "file_size": 1555, "cut_index": 537, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Intl\Currencies; use Symfony\Comp...
tValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Currency) { throw new UnexpectedTypeException($constraint, Currency::class); } if (null === $value
expectedValueException; /** * Validates whether a value is a valid currency. * * @author Miha Vrhovnik <miha.vrhovnik@pagein.si> * @author Bernhard Schussek <bschussek@gmail.com> */ class CurrencyValidator extends Constrain
{ "filepath": "src/Symfony/Component/Validator/Constraints/CurrencyValidator.php", "language": "php", "file_size": 1548, "cut_index": 537, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Const...
public static function checkDate(int $year, int $month, int $day): bool { return checkdate($month, $day, $year); } public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Date)
sek@gmail.com> */ class DateValidator extends ConstraintValidator { public const PATTERN = '/^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/D'; /** * Checks whether a date is valid. * * @internal */
{ "filepath": "src/Symfony/Component/Validator/Constraints/DateValidator.php", "language": "php", "file_size": 2136, "cut_index": 563, "middle_length": 229 }
* This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; /** * Validates that a value is divisib...
ctComparison { public const NOT_DIVISIBLE_BY = '6d99d6c3-1464-4ccf-bdc7-14d083cf455c'; protected const ERROR_NAMES = [ self::NOT_DIVISIBLE_BY => 'NOT_DIVISIBLE_BY', ]; public string $message = 'This value should be a multiple of {
extends Abstra
{ "filepath": "src/Symfony/Component/Validator/Constraints/DivisibleBy.php", "language": "php", "file_size": 817, "cut_index": 522, "middle_length": 14 }
n Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; /** * Validates a whole class, including nested object...
lude Properties excluded from validation */ public function __construct(array|string|null $exclude = null) { parent::__construct(); $this->exclude = array_flip((array) $exclude); } public function getTargets(): string
@param non-empty-string[]|non-empty-string|null $exc
{ "filepath": "src/Symfony/Component/Validator/Constraints/Cascade.php", "language": "php", "file_size": 950, "cut_index": 582, "middle_length": 52 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Com...
s Cidr extends Constraint { public const INVALID_CIDR_ERROR = '5649e53a-5afb-47c5-a360-ffbab3be8567'; public const OUT_OF_RANGE_ERROR = 'b9f14a51-acbd-401a-a078-8c6b204ab32f'; protected const ERROR_NAMES = [ self::INVALID_CIDR_ERROR =>
hor Sorin Pop <popsorin15@gmail.com> * @author Calin Bolea <calin.bolea@gmail.com> * @author Ninos Ego <me@ninosego.de> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] clas
{ "filepath": "src/Symfony/Component/Validator/Constraints/Cidr.php", "language": "php", "file_size": 3905, "cut_index": 614, "middle_length": 229 }
n Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use...
$constraint): void { if (!$constraint instanceof Compound) { throw new UnexpectedTypeException($constraint, Compound::class); } $context = $this->context; $validator = $context->getValidator()->inContext($c
public function validate(mixed $value, Constraint
{ "filepath": "src/Symfony/Component/Validator/Constraints/CompoundValidator.php", "language": "php", "file_size": 972, "cut_index": 582, "middle_length": 52 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony...
c const INVALID_FORMAT_ERROR = '69819696-02ac-4a99-9ff0-14e127c4d1bc'; public const INVALID_DATE_ERROR = '3c184ce5-b31d-4de7-8b76-326da7b2be93'; protected const ERROR_NAMES = [ self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR',
/manual/en/datetime.format.php * * @author Bernhard Schussek <bschussek@gmail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Date extends Constraint { publi
{ "filepath": "src/Symfony/Component/Validator/Constraints/Date.php", "language": "php", "file_size": 1651, "cut_index": 537, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Egulias\EmailValidator\EmailValidator as EguliasEmailValidator; use Egulias\EmailValidator\Validation\EmailValidation; use Eguli...
author Bernhard Schussek <bschussek@gmail.com> */ class EmailValidator extends ConstraintValidator { private const PATTERN_HTML5_ALLOW_NO_TLD = '/^[a-zA-Z0-9.!#$%&\'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-z
\InvalidArgumentException; use Symfony\Component\Validator\Exception\LogicException; use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @
{ "filepath": "src/Symfony/Component/Validator/Constraints/EmailValidator.php", "language": "php", "file_size": 4398, "cut_index": 614, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Const...
eException($constraint, Count::class); } if (null === $value) { return; } if (!\is_array($value) && !$value instanceof \Countable) { throw new UnexpectedValueException($value, 'array|\Countable');
sek@gmail.com> */ class CountValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Count) { throw new UnexpectedTyp
{ "filepath": "src/Symfony/Component/Validator/Constraints/CountValidator.php", "language": "php", "file_size": 2812, "cut_index": 563, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Egulias\EmailValidator\EmailValidator as StrictEmailValidator; use Symfony\Component\Validator\Constraint; use Symfony\Component...
-tld'; public const VALIDATION_MODE_HTML5 = 'html5'; public const VALIDATION_MODE_STRICT = 'strict'; public const INVALID_FORMAT_ERROR = 'bd79c0ab-ddba-46cc-a703-a7a4b08de310'; public const VALIDATION_MODES = [ self::VALIDATION_MO
k <bschussek@gmail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Email extends Constraint { public const VALIDATION_MODE_HTML5_ALLOW_NO_TLD = 'html5-allow-no
{ "filepath": "src/Symfony/Component/Validator/Constraints/Email.php", "language": "php", "file_size": 3095, "cut_index": 614, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; /** * Validates th...
'hex_short_with_alpha'; public const BASIC_NAMED_COLORS = 'basic_named_colors'; public const EXTENDED_NAMED_COLORS = 'extended_named_colors'; public const SYSTEM_COLORS = 'system_colors'; public const KEYWORDS = 'keywords'; public cons
EATABLE)] class CssColor extends Constraint { public const HEX_LONG = 'hex_long'; public const HEX_LONG_WITH_ALPHA = 'hex_long_with_alpha'; public const HEX_SHORT = 'hex_short'; public const HEX_SHORT_WITH_ALPHA =
{ "filepath": "src/Symfony/Component/Validator/Constraints/CssColor.php", "language": "php", "file_size": 3447, "cut_index": 614, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Excep...
nst TOO_SHORT_ERROR = '6a20dd3d-f463-4460-8e7b-18a1b98abbfb'; public const TOO_LONG_ERROR = '37cef893-5871-464e-8b12-7fb79324833c'; public const MISSING_HYPHEN_ERROR = '2983286f-8134-4693-957a-1ec4ef887b15'; public const INVALID_CHARACTERS_ERRO
cía Lagar <aj@garcialagar.es> * @author Bernhard Schussek <bschussek@gmail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Issn extends Constraint { public co
{ "filepath": "src/Symfony/Component/Validator/Constraints/Issn.php", "language": "php", "file_size": 2785, "cut_index": 563, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony...
validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Regex) { throw new UnexpectedTypeException($constraint, Regex::class); } if (null === $value || '' === $value) { return
es whether a value match or not given regexp pattern. * * @author Bernhard Schussek <bschussek@gmail.com> * @author Joseph Bielawski <stloyd@gmail.com> */ class RegexValidator extends ConstraintValidator { public function
{ "filepath": "src/Symfony/Component/Validator/Constraints/RegexValidator.php", "language": "php", "file_size": 1776, "cut_index": 537, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Intl\Languages; use Symfony\Component\Validator\Constraint;...
IS_REPEATABLE)] class Language extends Constraint { public const NO_SUCH_LANGUAGE_ERROR = 'ee65fec4-9a20-4202-9f39-ca558cd7bdf7'; protected const ERROR_NAMES = [ self::NO_SUCH_LANGUAGE_ERROR => 'NO_SUCH_LANGUAGE_ERROR', ]; public
ge identifier. * * @see https://unicode.org/reports/tr35/#Unicode_language_identifier * * @author Bernhard Schussek <bschussek@gmail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::
{ "filepath": "src/Symfony/Component/Validator/Constraints/Language.php", "language": "php", "file_size": 2140, "cut_index": 563, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony...
ally extends Composite { public array|Constraint $constraints = []; /** * @param Constraint[]|null $constraints An array of validation constraints * @param string[]|null $groups */ public function __construct(array|Constrain
t first violation. * * @author Maxime Steinhausser <maxime.steinhausser@gmail.com> */ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Sequenti
{ "filepath": "src/Symfony/Component/Validator/Constraints/Sequentially.php", "language": "php", "file_size": 1651, "cut_index": 537, "middle_length": 229 }
/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Cons...
TypeException($constraint, Sequentially::class); } $context = $this->context; $validator = $context->getValidator()->inContext($context); $originalCount = $validator->getViolations()->count(); foreach ($constrain
om> */ class SequentiallyValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Sequentially) { throw new Unexpected
{ "filepath": "src/Symfony/Component/Validator/Constraints/SequentiallyValidator.php", "language": "php", "file_size": 1179, "cut_index": 518, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony...
INVALID_TIME_ERROR = '8532f9e1-84b2-4d67-8989-0818bc38533b'; protected const ERROR_NAMES = [ self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', self::INVALID_TIME_ERROR => 'INVALID_TIME_ERROR', ]; public bool $withSeconds =
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Time extends Constraint { public const INVALID_FORMAT_ERROR = '9d27b2bb-f755-4fbf-b725-39b1edbdebdf'; public const
{ "filepath": "src/Symfony/Component/Validator/Constraints/Time.php", "language": "php", "file_size": 1839, "cut_index": 537, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Const...
ime is valid. * * @internal */ public static function checkTime(int $hour, int $minute, float $second): bool { return $hour >= 0 && $hour < 24 && $minute >= 0 && $minute < 60 && $second >= 0 && $second < 60; } public
sek@gmail.com> */ class TimeValidator extends ConstraintValidator { public const PATTERN = '/^(\d{2}):(\d{2}):(\d{2})$/D'; public const PATTERN_WITHOUT_SECONDS = '/^(\d{2}):(\d{2})$/D'; /** * Checks whether a t
{ "filepath": "src/Symfony/Component/Validator/Constraints/TimeValidator.php", "language": "php", "file_size": 2232, "cut_index": 563, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; /** * Validat...
b57767b1-36c0-40ac-a3d7-629420c775b8'; public const TIMEZONE_IDENTIFIER_IN_COUNTRY_ERROR = 'c4a22222-dc92-4fc0-abb0-d95b268c7d0b'; public const TIMEZONE_IDENTIFIER_INTL_ERROR = '45863c26-88dc-41ba-bf53-c73bd1f7e90d'; public int $zone = \DateTi
ttribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Timezone extends Constraint { public const TIMEZONE_IDENTIFIER_ERROR = '5ce113e6-5e64-4ea2-90fe-d2233956db13'; public const TIMEZONE_IDENTIFIER_IN_ZONE_ERROR = '
{ "filepath": "src/Symfony/Component/Validator/Constraints/Timezone.php", "language": "php", "file_size": 3426, "cut_index": 614, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Intl\Exception\MissingResourceException; use Symfony\Component\Intl\Timezones; use Symfony\Component\Validator...
public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Timezone) { throw new UnexpectedTypeException($constraint, Timezone::class); } if (null === $value || '' === $val
ception; /** * Validates whether a value is a valid timezone identifier. * * @author Javier Spagnoletti <phansys@gmail.com> * @author Hugo Hamon <hugohamon@neuf.fr> */ class TimezoneValidator extends ConstraintValidator {
{ "filepath": "src/Symfony/Component/Validator/Constraints/TimezoneValidator.php", "language": "php", "file_size": 3818, "cut_index": 614, "middle_length": 229 }
?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator...
). */ public function __construct(?bool $traverse = null, mixed $payload = null) { parent::__construct(null, $payload); $this->traverse = $traverse ?? $this->traverse; } public function getTargets(): string|array
nstraint { public bool $traverse = true; /** * @param bool|null $traverse Whether to traverse the given object or not (defaults to true). Pass an associative array to configure the constraint's options (e.g. payload
{ "filepath": "src/Symfony/Component/Validator/Constraints/Traverse.php", "language": "php", "file_size": 1047, "cut_index": 513, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony...
self::INVALID_TYPE_ERROR => 'INVALID_TYPE_ERROR', ]; public string $message = 'This value should be of type {{ type }}.'; public string|array|null $type = null; /** * @param string|list<string>|null $type The type(s) to enfor
bute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Type extends Constraint { public const INVALID_TYPE_ERROR = 'ba785a8c-82cb-4283-967c-3cf342181b40'; protected const ERROR_NAMES = [
{ "filepath": "src/Symfony/Component/Validator/Constraints/Type.php", "language": "php", "file_size": 1548, "cut_index": 537, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exc...
t', 'number' => 'is_int || is_float && !is_nan', 'finite-float' => 'is_float && is_finite', 'finite-number' => 'is_int || is_float && is_finite', 'numeric' => 'is_numeric', 'string' => 'is_string', 'scalar' =
'bool' => 'is_bool', 'boolean' => 'is_bool', 'int' => 'is_int', 'integer' => 'is_int', 'long' => 'is_int', 'float' => 'is_float', 'double' => 'is_float', 'real' => 'is_floa
{ "filepath": "src/Symfony/Component/Validator/Constraints/TypeValidator.php", "language": "php", "file_size": 3219, "cut_index": 614, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Excep...
tends Constraint { public const TOO_SHORT_ERROR = '7b44804e-37d5-4df4-9bdd-b738d4a45bb4'; public const TOO_LONG_ERROR = '9608249f-6da1-4d53-889e-9864b58c4d37'; public const TOO_LARGE_ERROR = 'df8cfb9a-ce6d-4a69-ae5a-eea7ab6f278b'; public co
Identifier (ULID). * * @see https://github.com/ulid/spec * * @author Laurent Clouet <laurent35240@gmail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Ulid ex
{ "filepath": "src/Symfony/Component/Validator/Constraints/Ulid.php", "language": "php", "file_size": 2692, "cut_index": 563, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exc...
, Constraint $constraint): void { if (!$constraint instanceof Ulid) { throw new UnexpectedTypeException($constraint, Ulid::class); } if (null === $value || '' === $value) { return; } if
rtable Identifier). * Cf https://github.com/ulid/spec for ULID specifications. * * @author Laurent Clouet <laurent35240@gmail.com> */ class UlidValidator extends ConstraintValidator { public function validate(mixed $value
{ "filepath": "src/Symfony/Component/Validator/Constraints/UlidValidator.php", "language": "php", "file_size": 3695, "cut_index": 614, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Excep...
public ?string $errorPath = null; public bool $stopOnFirstError = true; protected const ERROR_NAMES = [ self::IS_NOT_UNIQUE => 'IS_NOT_UNIQUE', ]; public string $message = 'This collection should contain only unique elements.
ttribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Unique extends Constraint { public const IS_NOT_UNIQUE = '7911c98d-b845-4da0-94b7-a8dac36bc55a'; public array|string $fields = [];
{ "filepath": "src/Symfony/Component/Validator/Constraints/Unique.php", "language": "php", "file_size": 2447, "cut_index": 563, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Const...
UnexpectedTypeException($constraint, Unique::class); } $fields = (array) $constraint->fields; if (null === $value) { return; } if (!\is_array($value) && !$value instanceof \IteratorAggregate) {
nya.zholkevskiy@gmail.com> */ class UniqueValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Unique) { throw new
{ "filepath": "src/Symfony/Component/Validator/Constraints/UniqueValidator.php", "language": "php", "file_size": 2792, "cut_index": 563, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; /** * Validates th...
self::INVALID_URL_ERROR => 'INVALID_URL_ERROR', self::MISSING_TLD_ERROR => 'MISSING_TLD_ERROR', ]; public string $message = 'This value is not a valid URL.'; public string $tldMessage = 'This URL is missing a top-level domain.'; pu
lass Url extends Constraint { public const INVALID_URL_ERROR = '57c2f299-1154-4870-89bb-ef3b1f5ad229'; public const MISSING_TLD_ERROR = '8a5d387f-0716-46b4-844b-67367faf435a'; protected const ERROR_NAMES = [
{ "filepath": "src/Symfony/Component/Validator/Constraints/Url.php", "language": "php", "file_size": 3125, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component\Validator\Exception\UnexpectedValueException; /...
(?:[\pL\pN\pS\pM\-\_]++\.)+ (?: (?:xn--[a-z0-9-]++) # punycode in tld | (?:[\pL\pN\pM]++) # no punycode in tld
# protocol ((?:[\pL\pN\-._~!$&'()*+,;=]|%%[0-9A-Fa-f]{2})++(?::(?:[:\pL\pN\-._~!$&'()*+,;=]|%%[0-9A-Fa-f]{2})*+)?@)? # basic auth ( (?: (?:
{ "filepath": "src/Symfony/Component/Validator/Constraints/UrlValidator.php", "language": "php", "file_size": 5873, "cut_index": 716, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; /** * Validates th...
public const TOO_SHORT_ERROR = 'aa314679-dac9-4f54-bf97-b2049df8f2a3'; public const TOO_LONG_ERROR = '494897dd-36f8-4d31-8923-71a8d5f3000d'; public const INVALID_CHARACTERS_ERROR = '51120b12-a2bc-41bf-aa53-cd73daf330d0'; public const INVALI
author Colin O'Dell <colinodell@gmail.com> * @author Bernhard Schussek <bschussek@gmail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Uuid extends Constraint {
{ "filepath": "src/Symfony/Component/Validator/Constraints/Uuid.php", "language": "php", "file_size": 4515, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component\Validator\Exception\UnexpectedValueException; /...
*/ class UuidValidator extends ConstraintValidator { // The strict pattern matches UUIDs like this: // xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx // Roughly speaking: // x = any hexadecimal character // M = any allowed version {1..8} //
D. * * @author Colin O'Dell <colinodell@gmail.com> * @author Bernhard Schussek <bschussek@gmail.com> * * @see https://datatracker.ietf.org/doc/html/rfc9562 * @see https://en.wikipedia.org/wiki/Universally_unique_identifier
{ "filepath": "src/Symfony/Component/Validator/Constraints/UuidValidator.php", "language": "php", "file_size": 8689, "cut_index": 716, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony...
erse Whether to validate {@see \Traversable} objects (defaults to true) */ public function __construct(?array $options = null, ?array $groups = null, $payload = null, ?bool $traverse = null) { if (null !== $options) { throw
ttribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Valid extends Constraint { public bool $traverse = true; /** * @param string[]|null $groups * @param bool|null $trav
{ "filepath": "src/Symfony/Component/Validator/Constraints/Valid.php", "language": "php", "file_size": 1710, "cut_index": 537, "middle_length": 229 }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validato...
Exception($constraint, Valid::class); } if (null === $value) { return; } $this->context ->getValidator() ->inContext($this->context) ->validate($value, null, $this->context->
ensiolabs.de> */ class ValidValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Valid) { throw new UnexpectedType
{ "filepath": "src/Symfony/Component/Validator/Constraints/ValidValidator.php", "language": "php", "file_size": 1018, "cut_index": 512, "middle_length": 229 }
Exception\LogicException; /** * @author Kev <https://github.com/symfonyaml> * @author Nicolas Grekas <p@tchwork.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Video extends File { public const SIZE_NOT_DETECTED_ERROR = '5dab98df-43c8-481b-94f9-46...
ERROR = 'ff0a8ee8-951d-4c97-afe2-03c0d61a2a02'; public const RATIO_TOO_BIG_ERROR = '5e6b9c21-d4d8-444d-9f4c-e3ff1e25a9a6'; public const RATIO_TOO_SMALL_ERROR = '26985857-7447-49dc-b271-1477a76cc63c'; public const SQUARE_NOT_ALLOWED_ERROR = '185
OR = '44f4c411-0199-48c2-b597-df1f5944ccde'; public const TOO_LOW_ERROR = '0b6bc3ce-df90-40f9-90aa-5bbb840cb481'; public const TOO_FEW_PIXEL_ERROR = '510ddf98-2eda-436e-be7e-b6f107bc0e22'; public const TOO_MANY_PIXEL_
{ "filepath": "src/Symfony/Component/Validator/Constraints/Video.php", "language": "php", "file_size": 15057, "cut_index": 921, "middle_length": 229 }
ption\ConstraintDefinitionException; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** * @author Kev <https://github.com/symfonyaml> * @author Nicolas Grekas <p@tchwork.com> */ class VideoValidator extends FileValidator { public function validate(mixed $value, Constraint $constraint): void ...
if (null === $constraint->minWidth && null === $constraint->maxWidth && null === $constraint->minHeight && null === $constraint->maxHeight && null === $constraint->minPixels && null === $constraint->maxPixels && null ==
ns()); parent::validate($value, $constraint); $failed = \count($this->context->getViolations()) !== $violations; if ($failed || null === $value || '' === $value) { return; }
{ "filepath": "src/Symfony/Component/Validator/Constraints/VideoValidator.php", "language": "php", "file_size": 10483, "cut_index": 921, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Excep...
_LOW_ERROR = '9b506423-77a3-4749-aa34-c822a08be978'; public const TOO_HIGH_ERROR = '85156377-d1e6-42cd-8f6e-dc43c2ecb72b'; protected const ERROR_NAMES = [ self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', self::INVALID_WEEK_NUM
BLE)] final class Week extends Constraint { public const INVALID_FORMAT_ERROR = '19012dd1-01c8-4ce8-959f-72ad22684f5f'; public const INVALID_WEEK_NUMBER_ERROR = 'd67ebfc9-45fe-4e4c-a038-5eaa56895ea3'; public const TOO
{ "filepath": "src/Symfony/Component/Validator/Constraints/Week.php", "language": "php", "file_size": 2900, "cut_index": 563, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Const...
ctedTypeException($constraint, Week::class); } if (null === $value) { return; } if (!\is_string($value) && !$value instanceof \Stringable) { throw new UnexpectedValueException($value, 'string');
aubois@gmail.com> */ final class WeekValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Week) { throw new Unexpe
{ "filepath": "src/Symfony/Component/Validator/Constraints/WeekValidator.php", "language": "php", "file_size": 2802, "cut_index": 563, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\ExpressionLanguage\Expression; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; use Symfony\Compon...
bute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class When extends Composite { public string|Expression|\Closure $expression; public array|Constraint $constraints = []; publi
n\MissingOptionsException; /** * Conditionally apply validation constraints based on an expression using the ExpressionLanguage syntax. * * @see https://symfony.com/doc/current/components/expression_language.html */ #[\Attri
{ "filepath": "src/Symfony/Component/Validator/Constraints/When.php", "language": "php", "file_size": 3206, "cut_index": 614, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; use Symfony\Componen...
aint): void { if (!$constraint instanceof When) { throw new UnexpectedTypeException($constraint, When::class); } $context = $this->context; $variables = $constraint->values; $variables['value'] = $va
xception; final class WhenValidator extends ConstraintValidator { public function __construct(private ?ExpressionLanguage $expressionLanguage = null) { } public function validate(mixed $value, Constraint $constr
{ "filepath": "src/Symfony/Component/Validator/Constraints/WhenValidator.php", "language": "php", "file_size": 2152, "cut_index": 563, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Excep...
1a642-f662-4fad-8761-79250eef74cb'; protected const ERROR_NAMES = [ self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR', self::TOO_LONG_ERROR => 'TOO_LONG_ERROR', ]; /** * @param int<0, max>|null $min * @param positive-int|n
ARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] final class WordCount extends Constraint { public const TOO_SHORT_ERROR = 'cc4925df-b5a6-42dd-87f3-21919f349bf3'; public const TOO_LONG_ERROR = 'a95
{ "filepath": "src/Symfony/Component/Validator/Constraints/WordCount.php", "language": "php", "file_size": 2725, "cut_index": 563, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Const...
throw new \RuntimeException(\sprintf('The "%s" constraint requires the "intl" PHP extension.', __CLASS__)); } if (!$constraint instanceof WordCount) { throw new UnexpectedTypeException($constraint, WordCount::class); }
aubois@gmail.com> */ final class WordCountValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!class_exists(\IntlBreakIterator::class)) {
{ "filepath": "src/Symfony/Component/Validator/Constraints/WordCountValidator.php", "language": "php", "file_size": 2427, "cut_index": 563, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Excep...
INVALID_XML_ERROR = '0355230a-97b8-49da-b8cd-985bf3345bcf'; public const INVALID_SCHEMA_ERROR = '1c2ab9d4-7d20-4f0c-83a3-3f2e6b34d7e1'; public const TOO_LARGE_ERROR = '6f1aa7a3-7d4d-4f1b-9c45-1f9c2d8f3b9b'; protected const ERROR_NAMES = [
is a valid XML string. * * @author Mokhtar Tlili <tlili.mokhtar@gmail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Xml extends Constraint { public const
{ "filepath": "src/Symfony/Component/Validator/Constraints/Xml.php", "language": "php", "file_size": 3015, "cut_index": 563, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exc...
UnexpectedTypeException($constraint, Xml::class); } if (null === $value || '' === $value) { return; } if (!\is_scalar($value) && !$value instanceof \Stringable) { throw new UnexpectedValueException(
Tlili <tlili.mokhtar@gmail.com> */ class XmlValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Xml) { throw new
{ "filepath": "src/Symfony/Component/Validator/Constraints/XmlValidator.php", "language": "php", "file_size": 3541, "cut_index": 614, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint...
ML_ERROR => 'INVALID_YAML_ERROR', ]; /** * @param int-mask-of<\Symfony\Component\Yaml\Yaml::PARSE_*> $flags * @param string[]|null $groups */ public function __construct( public strin
| \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Yaml extends Constraint { public const INVALID_YAML_ERROR = '63313a31-837c-42bb-99eb-542c76aacc48'; protected const ERROR_NAMES = [ self::INVALID_YA
{ "filepath": "src/Symfony/Component/Validator/Constraints/Yaml.php", "language": "php", "file_size": 1418, "cut_index": 524, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Const...
{ if (!$constraint instanceof Yaml) { throw new UnexpectedTypeException($constraint, Yaml::class); } if (null === $value || '' === $value) { return; } if (!\is_scalar($value) && !$value ins
eException; use Symfony\Component\Yaml\Parser; /** * @author Kev <https://github.com/symfonyaml> */ class YamlValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void
{ "filepath": "src/Symfony/Component/Validator/Constraints/YamlValidator.php", "language": "php", "file_size": 2151, "cut_index": 563, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; use Symfony\Componen...
_LONG_ERROR = 'd94b19cc-114f-4f44-9cc4-4138e80a87b9'; public const NOT_EQUAL_LENGTH_ERROR = '4b6f5c76-22b4-409d-af16-fbe823ba9332'; public const INVALID_CHARACTERS_ERROR = '35e6a710-aa2e-4719-b58e-24b35749b767'; protected const ERROR_NAMES = [
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Length extends Constraint { public const TOO_SHORT_ERROR = '9ff3fdc4-b214-49db-8718-39c315e33d45'; public const TOO
{ "filepath": "src/Symfony/Component/Validator/Constraints/Length.php", "language": "php", "file_size": 4902, "cut_index": 614, "middle_length": 229 }
file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; /** * Validates that a value is less than anot...
stractComparison { public const TOO_HIGH_ERROR = '079d7420-2d13-460c-8756-de810eeb37d2'; protected const ERROR_NAMES = [ self::TOO_HIGH_ERROR => 'TOO_HIGH_ERROR', ]; public string $message = 'This value should be less than {{ comp
Attribute::IS_REPEATABLE)] class LessThan extends Ab
{ "filepath": "src/Symfony/Component/Validator/Constraints/LessThan.php", "language": "php", "file_size": 856, "cut_index": 529, "middle_length": 52 }
?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; /** * Validates values are les...
lidator { protected function compareValues(mixed $value1, mixed $value2): bool { return null === $value2 || $value1 <= $value2; } protected function getErrorCode(): ?string { return LessThanOrEqual::TOO_HIGH_ERROR;
ctComparisonVa
{ "filepath": "src/Symfony/Component/Validator/Constraints/LessThanOrEqualValidator.php", "language": "php", "file_size": 787, "cut_index": 513, "middle_length": 14 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Intl\Locales; use Symfony\Compone...
e, Constraint $constraint): void { if (!$constraint instanceof Locale) { throw new UnexpectedTypeException($constraint, Locale::class); } if (null === $value || '' === $value) { return; }
ectedValueException; /** * Validates whether a value is a valid locale code. * * @author Bernhard Schussek <bschussek@gmail.com> */ class LocaleValidator extends ConstraintValidator { public function validate(mixed $valu
{ "filepath": "src/Symfony/Component/Validator/Constraints/LocaleValidator.php", "language": "php", "file_size": 1646, "cut_index": 537, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony...
te::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Luhn extends Constraint { public const INVALID_CHARACTERS_ERROR = 'dfad6d23-1b74-4374-929b-5cbb56fc0d9e'; public const CHECKSUM_FAILED_ERROR = '4d760774-3f50-4cd5-a
n_algorithm * * @author Tim Nagel <t.nagel@infinite.net.au> * @author Greg Knapp http://gregk.me/2011/php-implementation-of-bank-card-luhn-algorithm/ * @author Bernhard Schussek <bschussek@gmail.com> */ #[\Attribute(\Attribu
{ "filepath": "src/Symfony/Component/Validator/Constraints/Luhn.php", "language": "php", "file_size": 1815, "cut_index": 537, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Excep...
AL_NO_BROADCAST = 'local_no_broadcast'; public const LOCAL_UNICAST = 'local_unicast'; public const LOCAL_MULTICAST = 'local_multicast'; public const LOCAL_MULTICAST_NO_BROADCAST = 'local_multicast_no_broadcast'; public const UNIVERSAL_ALL =
ARGET_METHOD | \Attribute::IS_REPEATABLE)] class MacAddress extends Constraint { public const ALL = 'all'; public const ALL_NO_BROADCAST = 'all_no_broadcast'; public const LOCAL_ALL = 'local_all'; public const LOC
{ "filepath": "src/Symfony/Component/Validator/Constraints/MacAddress.php", "language": "php", "file_size": 2863, "cut_index": 563, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; use Symfony\Component\Validator\Exception\LogicException; /** * Validates that the given string does not contain charact...
NVISIBLE_ERROR = '6ed60e6c-179b-4e93-8a6c-667d85c6de5e'; public const MIXED_NUMBERS_ERROR = '9f01fc26-3bc4-44b1-a6b1-c08e2412053a'; public const HIDDEN_OVERLAY_ERROR = '56380dc5-0476-4f04-bbaa-b68cd1c2d974'; protected const ERROR_NAMES = [
te::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class NoSuspiciousCharacters extends Constraint { public const RESTRICTION_LEVEL_ERROR = '1ece07dc-dca2-45f1-ba47-8d7dc3a12774'; public const I
{ "filepath": "src/Symfony/Component/Validator/Constraints/NoSuspiciousCharacters.php", "language": "php", "file_size": 5806, "cut_index": 716, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony...
otected const ERROR_NAMES = [ self::IS_BLANK_ERROR => 'IS_BLANK_ERROR', ]; public string $message = 'This value should not be blank.'; public bool $allowNull = false; /** @var callable|null */ public $normalizer; /**
ail.com> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class NotBlank extends Constraint { public const IS_BLANK_ERROR = 'c1051bb4-d103-4f74-8988-acbcafc7fdc3'; pr
{ "filepath": "src/Symfony/Component/Validator/Constraints/NotBlank.php", "language": "php", "file_size": 2007, "cut_index": 537, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\HttpClient\HttpClient; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintV...
a k-anonymity model to protect the password being searched for. * * @see https://haveibeenpwned.com/API/v2#SearchingPwnedPasswordsByRange * * @author Kévin Dunglas <dunglas@gmail.com> */ class NotCompromisedPasswordValidator extends ConstraintValidato
Exception; use Symfony\Contracts\HttpClient\Exception\ExceptionInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; /** * Checks if a password has been leaked in a data breach using haveibeenpwned.com's API. * Use
{ "filepath": "src/Symfony/Component/Validator/Constraints/NotCompromisedPasswordValidator.php", "language": "php", "file_size": 3648, "cut_index": 614, "middle_length": 229 }
ony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; /** * Validates that a value is not identical to another value. * * @author Daniel Holmes <daniel@danielholmes.org> * @a...
18-0dda-4129-a6d9-e216b9b454a0'; protected const ERROR_NAMES = [ self::IS_IDENTICAL_ERROR => 'IS_IDENTICAL_ERROR', ]; public string $message = 'This value should not be identical to {{ compared_value_type }} {{ compared_value }}.'; }
ison { public const IS_IDENTICAL_ERROR = '4aaac5
{ "filepath": "src/Symfony/Component/Validator/Constraints/NotIdenticalTo.php", "language": "php", "file_size": 914, "cut_index": 606, "middle_length": 52 }
?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator...
nstraint, NotNull::class); } if (null === $value) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode(NotNull::IS_NULL_ERROR
class NotNullValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof NotNull) { throw new UnexpectedTypeException($co
{ "filepath": "src/Symfony/Component/Validator/Constraints/NotNullValidator.php", "language": "php", "file_size": 1052, "cut_index": 513, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exc...
date(#[\SensitiveParameter] mixed $value, Constraint $constraint): void { if (!$constraint instanceof PasswordStrength) { throw new UnexpectedTypeException($constraint, PasswordStrength::class); } if (null === $valu
\Closure(string):PasswordStrength::STRENGTH_*)|null $passwordStrengthEstimator */ public function __construct( private readonly ?\Closure $passwordStrengthEstimator = null, ) { } public function vali
{ "filepath": "src/Symfony/Component/Validator/Constraints/PasswordStrengthValidator.php", "language": "php", "file_size": 3233, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Clock\ClockInterface; use Symfony\Component\Clock\DatePoint; use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; use Symfony\Component\PropertyAccess\Exception\UninitializedPropertyException; ...
angeValidator extends ConstraintValidator { public function __construct( private ?PropertyAccessorInterface $propertyAccessor = null, private ?ClockInterface $clock = null, ) { } public function validate(mixed $value, Const
\ConstraintValidator; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** * @author Bernhard Schussek <bschussek@gmail.com> */ class R
{ "filepath": "src/Symfony/Component/Validator/Constraints/RangeValidator.php", "language": "php", "file_size": 7583, "cut_index": 716, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\InvalidArgumentException; use Symfony\Componen...
self::REGEX_FAILED_ERROR => 'REGEX_FAILED_ERROR', ]; public string $message = 'This value is not valid.'; public ?string $pattern = null; public ?string $htmlPattern = null; public bool $match = true; /** @var callable|null */
ARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Regex extends Constraint { public const REGEX_FAILED_ERROR = 'de1e3db3-5ed4-4941-aae4-59f3667cc3a3'; protected const ERROR_NAMES = [
{ "filepath": "src/Symfony/Component/Validator/Constraints/Regex.php", "language": "php", "file_size": 4004, "cut_index": 614, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint...
throw new UnexpectedTypeException($constraint, Json::class); } if (null === $value || '' === $value) { return; } if (!\is_scalar($value) && !$value instanceof \Stringable) { throw new Unexp
** * @author Imad ZAIRIG <imadzairig@gmail.com> */ class JsonValidator extends ConstraintValidator { public function validate(mixed $value, Constraint $constraint): void { if (!$constraint instanceof Json) {
{ "filepath": "src/Symfony/Component/Validator/Constraints/JsonValidator.php", "language": "php", "file_size": 1375, "cut_index": 524, "middle_length": 229 }