From 465d9aa26de67f872ed2ead29f99ee828c95d208 Mon Sep 17 00:00:00 2001 From: Artyum Petrov Date: Sun, 28 Aug 2022 23:20:05 +0400 Subject: [PATCH 01/12] Added the \Attribute::TARGET_PARAMETER constant to almost all constraints --- src/Symfony/Component/Validator/Constraints/All.php | 2 +- src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php | 2 +- src/Symfony/Component/Validator/Constraints/Bic.php | 2 +- src/Symfony/Component/Validator/Constraints/Blank.php | 2 +- src/Symfony/Component/Validator/Constraints/Callback.php | 2 +- src/Symfony/Component/Validator/Constraints/CardScheme.php | 2 +- src/Symfony/Component/Validator/Constraints/Choice.php | 2 +- src/Symfony/Component/Validator/Constraints/Cidr.php | 2 +- src/Symfony/Component/Validator/Constraints/Collection.php | 2 +- src/Symfony/Component/Validator/Constraints/Count.php | 2 +- src/Symfony/Component/Validator/Constraints/Country.php | 2 +- src/Symfony/Component/Validator/Constraints/CssColor.php | 2 +- src/Symfony/Component/Validator/Constraints/Currency.php | 2 +- src/Symfony/Component/Validator/Constraints/Date.php | 2 +- src/Symfony/Component/Validator/Constraints/DateTime.php | 2 +- src/Symfony/Component/Validator/Constraints/DivisibleBy.php | 2 +- src/Symfony/Component/Validator/Constraints/Email.php | 2 +- src/Symfony/Component/Validator/Constraints/EqualTo.php | 2 +- src/Symfony/Component/Validator/Constraints/Expression.php | 2 +- .../Component/Validator/Constraints/ExpressionSyntax.php | 2 +- src/Symfony/Component/Validator/Constraints/File.php | 2 +- src/Symfony/Component/Validator/Constraints/GreaterThan.php | 2 +- .../Component/Validator/Constraints/GreaterThanOrEqual.php | 2 +- src/Symfony/Component/Validator/Constraints/Hostname.php | 2 +- src/Symfony/Component/Validator/Constraints/Iban.php | 2 +- src/Symfony/Component/Validator/Constraints/IdenticalTo.php | 2 +- src/Symfony/Component/Validator/Constraints/Image.php | 2 +- src/Symfony/Component/Validator/Constraints/Ip.php | 2 +- src/Symfony/Component/Validator/Constraints/IsFalse.php | 2 +- src/Symfony/Component/Validator/Constraints/IsNull.php | 2 +- src/Symfony/Component/Validator/Constraints/IsTrue.php | 2 +- src/Symfony/Component/Validator/Constraints/Isbn.php | 2 +- src/Symfony/Component/Validator/Constraints/Isin.php | 2 +- src/Symfony/Component/Validator/Constraints/Issn.php | 2 +- src/Symfony/Component/Validator/Constraints/Json.php | 2 +- src/Symfony/Component/Validator/Constraints/Language.php | 2 +- src/Symfony/Component/Validator/Constraints/Length.php | 2 +- src/Symfony/Component/Validator/Constraints/LessThan.php | 2 +- src/Symfony/Component/Validator/Constraints/LessThanOrEqual.php | 2 +- src/Symfony/Component/Validator/Constraints/Locale.php | 2 +- src/Symfony/Component/Validator/Constraints/Luhn.php | 2 +- src/Symfony/Component/Validator/Constraints/Negative.php | 2 +- src/Symfony/Component/Validator/Constraints/NegativeOrZero.php | 2 +- src/Symfony/Component/Validator/Constraints/NotBlank.php | 2 +- .../Component/Validator/Constraints/NotCompromisedPassword.php | 2 +- src/Symfony/Component/Validator/Constraints/NotEqualTo.php | 2 +- src/Symfony/Component/Validator/Constraints/NotIdenticalTo.php | 2 +- src/Symfony/Component/Validator/Constraints/NotNull.php | 2 +- src/Symfony/Component/Validator/Constraints/Positive.php | 2 +- src/Symfony/Component/Validator/Constraints/PositiveOrZero.php | 2 +- src/Symfony/Component/Validator/Constraints/Range.php | 2 +- src/Symfony/Component/Validator/Constraints/Regex.php | 2 +- src/Symfony/Component/Validator/Constraints/Sequentially.php | 2 +- src/Symfony/Component/Validator/Constraints/Time.php | 2 +- src/Symfony/Component/Validator/Constraints/Timezone.php | 2 +- src/Symfony/Component/Validator/Constraints/Type.php | 2 +- src/Symfony/Component/Validator/Constraints/Ulid.php | 2 +- src/Symfony/Component/Validator/Constraints/Unique.php | 2 +- src/Symfony/Component/Validator/Constraints/Url.php | 2 +- src/Symfony/Component/Validator/Constraints/Uuid.php | 2 +- src/Symfony/Component/Validator/Constraints/Valid.php | 2 +- 61 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/Symfony/Component/Validator/Constraints/All.php b/src/Symfony/Component/Validator/Constraints/All.php index 1461b0348e8a..e6fc3e820e48 100644 --- a/src/Symfony/Component/Validator/Constraints/All.php +++ b/src/Symfony/Component/Validator/Constraints/All.php @@ -17,7 +17,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class All extends Composite { public $constraints = []; diff --git a/src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php b/src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php index 33ed343af7ae..282ff877e4de 100644 --- a/src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php +++ b/src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php @@ -17,7 +17,7 @@ * * @author Przemysław Bogusz */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class AtLeastOneOf extends Composite { public const AT_LEAST_ONE_OF_ERROR = 'f27e6d6c-261a-4056-b391-6673a623531c'; diff --git a/src/Symfony/Component/Validator/Constraints/Bic.php b/src/Symfony/Component/Validator/Constraints/Bic.php index dad4258dc0b6..f76ef793ec27 100644 --- a/src/Symfony/Component/Validator/Constraints/Bic.php +++ b/src/Symfony/Component/Validator/Constraints/Bic.php @@ -23,7 +23,7 @@ * * @author Michael Hirschler */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Bic extends Constraint { public const INVALID_LENGTH_ERROR = '66dad313-af0b-4214-8566-6c799be9789c'; diff --git a/src/Symfony/Component/Validator/Constraints/Blank.php b/src/Symfony/Component/Validator/Constraints/Blank.php index bd28e68bc81f..23958244697d 100644 --- a/src/Symfony/Component/Validator/Constraints/Blank.php +++ b/src/Symfony/Component/Validator/Constraints/Blank.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Blank extends Constraint { public const NOT_BLANK_ERROR = '183ad2de-533d-4796-a439-6d3c3852b549'; diff --git a/src/Symfony/Component/Validator/Constraints/Callback.php b/src/Symfony/Component/Validator/Constraints/Callback.php index 82f67962b257..e7804ad62047 100644 --- a/src/Symfony/Component/Validator/Constraints/Callback.php +++ b/src/Symfony/Component/Validator/Constraints/Callback.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Callback extends Constraint { /** diff --git a/src/Symfony/Component/Validator/Constraints/CardScheme.php b/src/Symfony/Component/Validator/Constraints/CardScheme.php index 067024769aea..87c36a9abf7c 100644 --- a/src/Symfony/Component/Validator/Constraints/CardScheme.php +++ b/src/Symfony/Component/Validator/Constraints/CardScheme.php @@ -22,7 +22,7 @@ * @author Tim Nagel * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class CardScheme extends Constraint { public const AMEX = 'AMEX'; diff --git a/src/Symfony/Component/Validator/Constraints/Choice.php b/src/Symfony/Component/Validator/Constraints/Choice.php index 5544688d0baf..bea42c580d59 100644 --- a/src/Symfony/Component/Validator/Constraints/Choice.php +++ b/src/Symfony/Component/Validator/Constraints/Choice.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Choice extends Constraint { public const NO_SUCH_CHOICE_ERROR = '8e179f1b-97aa-4560-a02f-2a8b42e49df7'; diff --git a/src/Symfony/Component/Validator/Constraints/Cidr.php b/src/Symfony/Component/Validator/Constraints/Cidr.php index c40669e824db..9e375ea46439 100644 --- a/src/Symfony/Component/Validator/Constraints/Cidr.php +++ b/src/Symfony/Component/Validator/Constraints/Cidr.php @@ -23,7 +23,7 @@ * @author Sorin Pop * @author Calin Bolea */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Cidr extends Constraint { public const INVALID_CIDR_ERROR = '5649e53a-5afb-47c5-a360-ffbab3be8567'; diff --git a/src/Symfony/Component/Validator/Constraints/Collection.php b/src/Symfony/Component/Validator/Constraints/Collection.php index e02bd1457d23..9de56f761767 100644 --- a/src/Symfony/Component/Validator/Constraints/Collection.php +++ b/src/Symfony/Component/Validator/Constraints/Collection.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Collection extends Composite { public const MISSING_FIELD_ERROR = '2fa2158c-2a7f-484b-98aa-975522539ff8'; diff --git a/src/Symfony/Component/Validator/Constraints/Count.php b/src/Symfony/Component/Validator/Constraints/Count.php index ea5d4182865d..76fa9672ef3f 100644 --- a/src/Symfony/Component/Validator/Constraints/Count.php +++ b/src/Symfony/Component/Validator/Constraints/Count.php @@ -20,7 +20,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Count extends Constraint { public const TOO_FEW_ERROR = 'bef8e338-6ae5-4caf-b8e2-50e7b0579e69'; diff --git a/src/Symfony/Component/Validator/Constraints/Country.php b/src/Symfony/Component/Validator/Constraints/Country.php index 03df0206bbed..b38ac6604f9e 100644 --- a/src/Symfony/Component/Validator/Constraints/Country.php +++ b/src/Symfony/Component/Validator/Constraints/Country.php @@ -21,7 +21,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Country extends Constraint { public const NO_SUCH_COUNTRY_ERROR = '8f900c12-61bd-455d-9398-996cd040f7f0'; diff --git a/src/Symfony/Component/Validator/Constraints/CssColor.php b/src/Symfony/Component/Validator/Constraints/CssColor.php index d1e2e2783430..1a018f72151b 100644 --- a/src/Symfony/Component/Validator/Constraints/CssColor.php +++ b/src/Symfony/Component/Validator/Constraints/CssColor.php @@ -20,7 +20,7 @@ * * @author Mathieu Santostefano */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class CssColor extends Constraint { public const HEX_LONG = 'hex_long'; diff --git a/src/Symfony/Component/Validator/Constraints/Currency.php b/src/Symfony/Component/Validator/Constraints/Currency.php index 5713d803e8cd..5db4e5d71cd0 100644 --- a/src/Symfony/Component/Validator/Constraints/Currency.php +++ b/src/Symfony/Component/Validator/Constraints/Currency.php @@ -22,7 +22,7 @@ * @author Miha Vrhovnik * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Currency extends Constraint { public const NO_SUCH_CURRENCY_ERROR = '69945ac1-2db4-405f-bec7-d2772f73df52'; diff --git a/src/Symfony/Component/Validator/Constraints/Date.php b/src/Symfony/Component/Validator/Constraints/Date.php index 1ca3bee11f35..4be29305c1e5 100644 --- a/src/Symfony/Component/Validator/Constraints/Date.php +++ b/src/Symfony/Component/Validator/Constraints/Date.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Date extends Constraint { public const INVALID_FORMAT_ERROR = '69819696-02ac-4a99-9ff0-14e127c4d1bc'; diff --git a/src/Symfony/Component/Validator/Constraints/DateTime.php b/src/Symfony/Component/Validator/Constraints/DateTime.php index f187f8b26685..465b83024594 100644 --- a/src/Symfony/Component/Validator/Constraints/DateTime.php +++ b/src/Symfony/Component/Validator/Constraints/DateTime.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class DateTime extends Constraint { public const INVALID_FORMAT_ERROR = '1a9da513-2640-4f84-9b6a-4d99dcddc628'; diff --git a/src/Symfony/Component/Validator/Constraints/DivisibleBy.php b/src/Symfony/Component/Validator/Constraints/DivisibleBy.php index 90164aab286b..06a73f41c6c5 100644 --- a/src/Symfony/Component/Validator/Constraints/DivisibleBy.php +++ b/src/Symfony/Component/Validator/Constraints/DivisibleBy.php @@ -17,7 +17,7 @@ * * @author Colin O'Dell */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class DivisibleBy extends AbstractComparison { public const NOT_DIVISIBLE_BY = '6d99d6c3-1464-4ccf-bdc7-14d083cf455c'; diff --git a/src/Symfony/Component/Validator/Constraints/Email.php b/src/Symfony/Component/Validator/Constraints/Email.php index 4340e7a7217d..3aae4dce9b47 100644 --- a/src/Symfony/Component/Validator/Constraints/Email.php +++ b/src/Symfony/Component/Validator/Constraints/Email.php @@ -22,7 +22,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Email extends Constraint { public const VALIDATION_MODE_HTML5 = 'html5'; diff --git a/src/Symfony/Component/Validator/Constraints/EqualTo.php b/src/Symfony/Component/Validator/Constraints/EqualTo.php index 03769ce8a84a..5481f6f12df0 100644 --- a/src/Symfony/Component/Validator/Constraints/EqualTo.php +++ b/src/Symfony/Component/Validator/Constraints/EqualTo.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class EqualTo extends AbstractComparison { public const NOT_EQUAL_ERROR = '478618a7-95ba-473d-9101-cabd45e49115'; diff --git a/src/Symfony/Component/Validator/Constraints/Expression.php b/src/Symfony/Component/Validator/Constraints/Expression.php index 089b4f8903e5..92daf0243868 100644 --- a/src/Symfony/Component/Validator/Constraints/Expression.php +++ b/src/Symfony/Component/Validator/Constraints/Expression.php @@ -23,7 +23,7 @@ * @author Fabien Potencier * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Expression extends Constraint { public const EXPRESSION_FAILED_ERROR = '6b3befbc-2f01-4ddf-be21-b57898905284'; diff --git a/src/Symfony/Component/Validator/Constraints/ExpressionSyntax.php b/src/Symfony/Component/Validator/Constraints/ExpressionSyntax.php index a614ae43fc6f..94eb38476cd3 100644 --- a/src/Symfony/Component/Validator/Constraints/ExpressionSyntax.php +++ b/src/Symfony/Component/Validator/Constraints/ExpressionSyntax.php @@ -19,7 +19,7 @@ * * @author Andrey Sevastianov */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class ExpressionSyntax extends Constraint { public const EXPRESSION_SYNTAX_ERROR = 'e219aa22-8b11-48ec-81a0-fc07cdb0e13f'; diff --git a/src/Symfony/Component/Validator/Constraints/File.php b/src/Symfony/Component/Validator/Constraints/File.php index 009251df4d4b..0a75d154e1e2 100644 --- a/src/Symfony/Component/Validator/Constraints/File.php +++ b/src/Symfony/Component/Validator/Constraints/File.php @@ -22,7 +22,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class File extends Constraint { // Check the Image constraint for clashes if adding new constants here diff --git a/src/Symfony/Component/Validator/Constraints/GreaterThan.php b/src/Symfony/Component/Validator/Constraints/GreaterThan.php index ce56f1ac1c81..81570ee664e0 100644 --- a/src/Symfony/Component/Validator/Constraints/GreaterThan.php +++ b/src/Symfony/Component/Validator/Constraints/GreaterThan.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class GreaterThan extends AbstractComparison { public const TOO_LOW_ERROR = '778b7ae0-84d3-481a-9dec-35fdb64b1d78'; diff --git a/src/Symfony/Component/Validator/Constraints/GreaterThanOrEqual.php b/src/Symfony/Component/Validator/Constraints/GreaterThanOrEqual.php index c962f7964f4b..30060a136cbc 100644 --- a/src/Symfony/Component/Validator/Constraints/GreaterThanOrEqual.php +++ b/src/Symfony/Component/Validator/Constraints/GreaterThanOrEqual.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class GreaterThanOrEqual extends AbstractComparison { public const TOO_LOW_ERROR = 'ea4e51d1-3342-48bd-87f1-9e672cd90cad'; diff --git a/src/Symfony/Component/Validator/Constraints/Hostname.php b/src/Symfony/Component/Validator/Constraints/Hostname.php index cbf33cd8d027..744cc046d078 100644 --- a/src/Symfony/Component/Validator/Constraints/Hostname.php +++ b/src/Symfony/Component/Validator/Constraints/Hostname.php @@ -19,7 +19,7 @@ * * @author Dmitrii Poddubnyi */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Hostname extends Constraint { public const INVALID_HOSTNAME_ERROR = '7057ffdb-0af4-4f7e-bd5e-e9acfa6d7a2d'; diff --git a/src/Symfony/Component/Validator/Constraints/Iban.php b/src/Symfony/Component/Validator/Constraints/Iban.php index 684df2e561e5..50e6a175f394 100644 --- a/src/Symfony/Component/Validator/Constraints/Iban.php +++ b/src/Symfony/Component/Validator/Constraints/Iban.php @@ -21,7 +21,7 @@ * @author Michael Schummel * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Iban extends Constraint { public const INVALID_COUNTRY_CODE_ERROR = 'de78ee2c-bd50-44e2-aec8-3d8228aeadb9'; diff --git a/src/Symfony/Component/Validator/Constraints/IdenticalTo.php b/src/Symfony/Component/Validator/Constraints/IdenticalTo.php index 50ec5e1297a1..b84876ebb3d9 100644 --- a/src/Symfony/Component/Validator/Constraints/IdenticalTo.php +++ b/src/Symfony/Component/Validator/Constraints/IdenticalTo.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class IdenticalTo extends AbstractComparison { public const NOT_IDENTICAL_ERROR = '2a8cc50f-58a2-4536-875e-060a2ce69ed5'; diff --git a/src/Symfony/Component/Validator/Constraints/Image.php b/src/Symfony/Component/Validator/Constraints/Image.php index 0a569c710248..fcc0ece64dc7 100644 --- a/src/Symfony/Component/Validator/Constraints/Image.php +++ b/src/Symfony/Component/Validator/Constraints/Image.php @@ -18,7 +18,7 @@ * @author Benjamin Dulau * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Image extends File { public const SIZE_NOT_DETECTED_ERROR = '6d55c3f4-e58e-4fe3-91ee-74b492199956'; diff --git a/src/Symfony/Component/Validator/Constraints/Ip.php b/src/Symfony/Component/Validator/Constraints/Ip.php index 94c4ca484766..47f50404bb9a 100644 --- a/src/Symfony/Component/Validator/Constraints/Ip.php +++ b/src/Symfony/Component/Validator/Constraints/Ip.php @@ -24,7 +24,7 @@ * @author Bernhard Schussek * @author Joseph Bielawski */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Ip extends Constraint { public const V4 = '4'; diff --git a/src/Symfony/Component/Validator/Constraints/IsFalse.php b/src/Symfony/Component/Validator/Constraints/IsFalse.php index 26042e2ee12b..19a9a199c708 100644 --- a/src/Symfony/Component/Validator/Constraints/IsFalse.php +++ b/src/Symfony/Component/Validator/Constraints/IsFalse.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class IsFalse extends Constraint { public const NOT_FALSE_ERROR = 'd53a91b0-def3-426a-83d7-269da7ab4200'; diff --git a/src/Symfony/Component/Validator/Constraints/IsNull.php b/src/Symfony/Component/Validator/Constraints/IsNull.php index 5084c268a1d7..1ea7a489fabc 100644 --- a/src/Symfony/Component/Validator/Constraints/IsNull.php +++ b/src/Symfony/Component/Validator/Constraints/IsNull.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class IsNull extends Constraint { public const NOT_NULL_ERROR = '60d2f30b-8cfa-4372-b155-9656634de120'; diff --git a/src/Symfony/Component/Validator/Constraints/IsTrue.php b/src/Symfony/Component/Validator/Constraints/IsTrue.php index 8ee9f729d04d..86607735519f 100644 --- a/src/Symfony/Component/Validator/Constraints/IsTrue.php +++ b/src/Symfony/Component/Validator/Constraints/IsTrue.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class IsTrue extends Constraint { public const NOT_TRUE_ERROR = '2beabf1c-54c0-4882-a928-05249b26e23b'; diff --git a/src/Symfony/Component/Validator/Constraints/Isbn.php b/src/Symfony/Component/Validator/Constraints/Isbn.php index 5b70c6fcbdc4..bcf3bb33eb98 100644 --- a/src/Symfony/Component/Validator/Constraints/Isbn.php +++ b/src/Symfony/Component/Validator/Constraints/Isbn.php @@ -21,7 +21,7 @@ * @author Manuel Reinhard * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Isbn extends Constraint { public const ISBN_10 = 'isbn10'; diff --git a/src/Symfony/Component/Validator/Constraints/Isin.php b/src/Symfony/Component/Validator/Constraints/Isin.php index 1522044befa8..a3dfcc5dc206 100644 --- a/src/Symfony/Component/Validator/Constraints/Isin.php +++ b/src/Symfony/Component/Validator/Constraints/Isin.php @@ -19,7 +19,7 @@ * * @author Laurent Masforné */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Isin extends Constraint { public const VALIDATION_LENGTH = 12; diff --git a/src/Symfony/Component/Validator/Constraints/Issn.php b/src/Symfony/Component/Validator/Constraints/Issn.php index a11f022e63e1..b65ebf70c7f9 100644 --- a/src/Symfony/Component/Validator/Constraints/Issn.php +++ b/src/Symfony/Component/Validator/Constraints/Issn.php @@ -20,7 +20,7 @@ * @author Antonio J. García Lagar * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Issn extends Constraint { public const TOO_SHORT_ERROR = '6a20dd3d-f463-4460-8e7b-18a1b98abbfb'; diff --git a/src/Symfony/Component/Validator/Constraints/Json.php b/src/Symfony/Component/Validator/Constraints/Json.php index f2826d28e39b..9c68e3fe019d 100644 --- a/src/Symfony/Component/Validator/Constraints/Json.php +++ b/src/Symfony/Component/Validator/Constraints/Json.php @@ -19,7 +19,7 @@ * * @author Imad ZAIRIG */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Json extends Constraint { public const INVALID_JSON_ERROR = '0789c8ad-2d2b-49a4-8356-e2ce63998504'; diff --git a/src/Symfony/Component/Validator/Constraints/Language.php b/src/Symfony/Component/Validator/Constraints/Language.php index e3c2ce9629dd..7dc5b8764f9b 100644 --- a/src/Symfony/Component/Validator/Constraints/Language.php +++ b/src/Symfony/Component/Validator/Constraints/Language.php @@ -21,7 +21,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Language extends Constraint { public const NO_SUCH_LANGUAGE_ERROR = 'ee65fec4-9a20-4202-9f39-ca558cd7bdf7'; diff --git a/src/Symfony/Component/Validator/Constraints/Length.php b/src/Symfony/Component/Validator/Constraints/Length.php index a25bf520ea60..232d164cdc6f 100644 --- a/src/Symfony/Component/Validator/Constraints/Length.php +++ b/src/Symfony/Component/Validator/Constraints/Length.php @@ -21,7 +21,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Length extends Constraint { public const TOO_SHORT_ERROR = '9ff3fdc4-b214-49db-8718-39c315e33d45'; diff --git a/src/Symfony/Component/Validator/Constraints/LessThan.php b/src/Symfony/Component/Validator/Constraints/LessThan.php index cf4144d6d26d..5aed52400d95 100644 --- a/src/Symfony/Component/Validator/Constraints/LessThan.php +++ b/src/Symfony/Component/Validator/Constraints/LessThan.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class LessThan extends AbstractComparison { public const TOO_HIGH_ERROR = '079d7420-2d13-460c-8756-de810eeb37d2'; diff --git a/src/Symfony/Component/Validator/Constraints/LessThanOrEqual.php b/src/Symfony/Component/Validator/Constraints/LessThanOrEqual.php index 84e31abfc021..9406eb0f31c5 100644 --- a/src/Symfony/Component/Validator/Constraints/LessThanOrEqual.php +++ b/src/Symfony/Component/Validator/Constraints/LessThanOrEqual.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class LessThanOrEqual extends AbstractComparison { public const TOO_HIGH_ERROR = '30fbb013-d015-4232-8b3b-8f3be97a7e14'; diff --git a/src/Symfony/Component/Validator/Constraints/Locale.php b/src/Symfony/Component/Validator/Constraints/Locale.php index 30f0ffd6eb30..bfa4ebded01b 100644 --- a/src/Symfony/Component/Validator/Constraints/Locale.php +++ b/src/Symfony/Component/Validator/Constraints/Locale.php @@ -21,7 +21,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Locale extends Constraint { public const NO_SUCH_LOCALE_ERROR = 'a0af4293-1f1a-4a1c-a328-979cba6182a2'; diff --git a/src/Symfony/Component/Validator/Constraints/Luhn.php b/src/Symfony/Component/Validator/Constraints/Luhn.php index 198fb29baf29..a03f4cfe0754 100644 --- a/src/Symfony/Component/Validator/Constraints/Luhn.php +++ b/src/Symfony/Component/Validator/Constraints/Luhn.php @@ -23,7 +23,7 @@ * @author Greg Knapp http://gregk.me/2011/php-implementation-of-bank-card-luhn-algorithm/ * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Luhn extends Constraint { public const INVALID_CHARACTERS_ERROR = 'dfad6d23-1b74-4374-929b-5cbb56fc0d9e'; diff --git a/src/Symfony/Component/Validator/Constraints/Negative.php b/src/Symfony/Component/Validator/Constraints/Negative.php index c13ebcb4a8b9..70370c92afa2 100644 --- a/src/Symfony/Component/Validator/Constraints/Negative.php +++ b/src/Symfony/Component/Validator/Constraints/Negative.php @@ -17,7 +17,7 @@ * * @author Jan Schädlich */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Negative extends LessThan { use ZeroComparisonConstraintTrait; diff --git a/src/Symfony/Component/Validator/Constraints/NegativeOrZero.php b/src/Symfony/Component/Validator/Constraints/NegativeOrZero.php index 5be735c312da..97ec55948097 100644 --- a/src/Symfony/Component/Validator/Constraints/NegativeOrZero.php +++ b/src/Symfony/Component/Validator/Constraints/NegativeOrZero.php @@ -17,7 +17,7 @@ * * @author Jan Schädlich */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class NegativeOrZero extends LessThanOrEqual { use ZeroComparisonConstraintTrait; diff --git a/src/Symfony/Component/Validator/Constraints/NotBlank.php b/src/Symfony/Component/Validator/Constraints/NotBlank.php index 38637ad20260..b40aa604a48a 100644 --- a/src/Symfony/Component/Validator/Constraints/NotBlank.php +++ b/src/Symfony/Component/Validator/Constraints/NotBlank.php @@ -21,7 +21,7 @@ * @author Bernhard Schussek * @author Kévin Dunglas */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class NotBlank extends Constraint { public const IS_BLANK_ERROR = 'c1051bb4-d103-4f74-8988-acbcafc7fdc3'; diff --git a/src/Symfony/Component/Validator/Constraints/NotCompromisedPassword.php b/src/Symfony/Component/Validator/Constraints/NotCompromisedPassword.php index 3329d3c1abc0..806612880c29 100644 --- a/src/Symfony/Component/Validator/Constraints/NotCompromisedPassword.php +++ b/src/Symfony/Component/Validator/Constraints/NotCompromisedPassword.php @@ -21,7 +21,7 @@ * * @author Kévin Dunglas */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class NotCompromisedPassword extends Constraint { public const COMPROMISED_PASSWORD_ERROR = 'd9bcdbfe-a9d6-4bfa-a8ff-da5fd93e0f6d'; diff --git a/src/Symfony/Component/Validator/Constraints/NotEqualTo.php b/src/Symfony/Component/Validator/Constraints/NotEqualTo.php index 9a5c07b21e2a..3da520b7eef1 100644 --- a/src/Symfony/Component/Validator/Constraints/NotEqualTo.php +++ b/src/Symfony/Component/Validator/Constraints/NotEqualTo.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class NotEqualTo extends AbstractComparison { public const IS_EQUAL_ERROR = 'aa2e33da-25c8-4d76-8c6c-812f02ea89dd'; diff --git a/src/Symfony/Component/Validator/Constraints/NotIdenticalTo.php b/src/Symfony/Component/Validator/Constraints/NotIdenticalTo.php index 206c10613732..4e70982d5f52 100644 --- a/src/Symfony/Component/Validator/Constraints/NotIdenticalTo.php +++ b/src/Symfony/Component/Validator/Constraints/NotIdenticalTo.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class NotIdenticalTo extends AbstractComparison { public const IS_IDENTICAL_ERROR = '4aaac518-0dda-4129-a6d9-e216b9b454a0'; diff --git a/src/Symfony/Component/Validator/Constraints/NotNull.php b/src/Symfony/Component/Validator/Constraints/NotNull.php index 2fd4123cdfca..eabd8044103f 100644 --- a/src/Symfony/Component/Validator/Constraints/NotNull.php +++ b/src/Symfony/Component/Validator/Constraints/NotNull.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class NotNull extends Constraint { public const IS_NULL_ERROR = 'ad32d13f-c3d4-423b-909a-857b961eb720'; diff --git a/src/Symfony/Component/Validator/Constraints/Positive.php b/src/Symfony/Component/Validator/Constraints/Positive.php index 951e944c9a7e..643ac9560ca9 100644 --- a/src/Symfony/Component/Validator/Constraints/Positive.php +++ b/src/Symfony/Component/Validator/Constraints/Positive.php @@ -17,7 +17,7 @@ * * @author Jan Schädlich */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Positive extends GreaterThan { use ZeroComparisonConstraintTrait; diff --git a/src/Symfony/Component/Validator/Constraints/PositiveOrZero.php b/src/Symfony/Component/Validator/Constraints/PositiveOrZero.php index a7669c61070d..0a35a6112326 100644 --- a/src/Symfony/Component/Validator/Constraints/PositiveOrZero.php +++ b/src/Symfony/Component/Validator/Constraints/PositiveOrZero.php @@ -17,7 +17,7 @@ * * @author Jan Schädlich */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class PositiveOrZero extends GreaterThanOrEqual { use ZeroComparisonConstraintTrait; diff --git a/src/Symfony/Component/Validator/Constraints/Range.php b/src/Symfony/Component/Validator/Constraints/Range.php index ca5cba3c985a..865fd1d56d37 100644 --- a/src/Symfony/Component/Validator/Constraints/Range.php +++ b/src/Symfony/Component/Validator/Constraints/Range.php @@ -23,7 +23,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Range extends Constraint { public const INVALID_CHARACTERS_ERROR = 'ad9a9798-7a99-4df7-8ce9-46e416a1e60b'; diff --git a/src/Symfony/Component/Validator/Constraints/Regex.php b/src/Symfony/Component/Validator/Constraints/Regex.php index 67dc8b37c67f..226f43e0b1ab 100644 --- a/src/Symfony/Component/Validator/Constraints/Regex.php +++ b/src/Symfony/Component/Validator/Constraints/Regex.php @@ -20,7 +20,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Regex extends Constraint { public const REGEX_FAILED_ERROR = 'de1e3db3-5ed4-4941-aae4-59f3667cc3a3'; diff --git a/src/Symfony/Component/Validator/Constraints/Sequentially.php b/src/Symfony/Component/Validator/Constraints/Sequentially.php index 5eea1ebba439..172eae45b873 100644 --- a/src/Symfony/Component/Validator/Constraints/Sequentially.php +++ b/src/Symfony/Component/Validator/Constraints/Sequentially.php @@ -20,7 +20,7 @@ * * @author Maxime Steinhausser */ -#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Sequentially extends Composite { public $constraints = []; diff --git a/src/Symfony/Component/Validator/Constraints/Time.php b/src/Symfony/Component/Validator/Constraints/Time.php index f281ae1ee85b..fbfeb6a1899f 100644 --- a/src/Symfony/Component/Validator/Constraints/Time.php +++ b/src/Symfony/Component/Validator/Constraints/Time.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Time extends Constraint { public const INVALID_FORMAT_ERROR = '9d27b2bb-f755-4fbf-b725-39b1edbdebdf'; diff --git a/src/Symfony/Component/Validator/Constraints/Timezone.php b/src/Symfony/Component/Validator/Constraints/Timezone.php index 03bc19e7cc66..f4d5e8885b76 100644 --- a/src/Symfony/Component/Validator/Constraints/Timezone.php +++ b/src/Symfony/Component/Validator/Constraints/Timezone.php @@ -21,7 +21,7 @@ * @author Javier Spagnoletti * @author Hugo Hamon */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Timezone extends Constraint { public const TIMEZONE_IDENTIFIER_ERROR = '5ce113e6-5e64-4ea2-90fe-d2233956db13'; diff --git a/src/Symfony/Component/Validator/Constraints/Type.php b/src/Symfony/Component/Validator/Constraints/Type.php index 97a5ef939d3f..ac512a8b4292 100644 --- a/src/Symfony/Component/Validator/Constraints/Type.php +++ b/src/Symfony/Component/Validator/Constraints/Type.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Type extends Constraint { public const INVALID_TYPE_ERROR = 'ba785a8c-82cb-4283-967c-3cf342181b40'; diff --git a/src/Symfony/Component/Validator/Constraints/Ulid.php b/src/Symfony/Component/Validator/Constraints/Ulid.php index ece08c721cd7..e4a36e6cc83a 100644 --- a/src/Symfony/Component/Validator/Constraints/Ulid.php +++ b/src/Symfony/Component/Validator/Constraints/Ulid.php @@ -18,7 +18,7 @@ * * @author Laurent Clouet */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Ulid extends Constraint { public const TOO_SHORT_ERROR = '7b44804e-37d5-4df4-9bdd-b738d4a45bb4'; diff --git a/src/Symfony/Component/Validator/Constraints/Unique.php b/src/Symfony/Component/Validator/Constraints/Unique.php index 6db31c0e4123..53b091e97906 100644 --- a/src/Symfony/Component/Validator/Constraints/Unique.php +++ b/src/Symfony/Component/Validator/Constraints/Unique.php @@ -20,7 +20,7 @@ * * @author Yevgeniy Zholkevskiy */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Unique extends Constraint { public const IS_NOT_UNIQUE = '7911c98d-b845-4da0-94b7-a8dac36bc55a'; diff --git a/src/Symfony/Component/Validator/Constraints/Url.php b/src/Symfony/Component/Validator/Constraints/Url.php index e3bea2e1b3d6..fa6c3fe2713a 100644 --- a/src/Symfony/Component/Validator/Constraints/Url.php +++ b/src/Symfony/Component/Validator/Constraints/Url.php @@ -20,7 +20,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Url extends Constraint { public const INVALID_URL_ERROR = '57c2f299-1154-4870-89bb-ef3b1f5ad229'; diff --git a/src/Symfony/Component/Validator/Constraints/Uuid.php b/src/Symfony/Component/Validator/Constraints/Uuid.php index 82b790578378..2e7bb0ccee5c 100644 --- a/src/Symfony/Component/Validator/Constraints/Uuid.php +++ b/src/Symfony/Component/Validator/Constraints/Uuid.php @@ -20,7 +20,7 @@ * @author Colin O'Dell * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Uuid extends Constraint { public const TOO_SHORT_ERROR = 'aa314679-dac9-4f54-bf97-b2049df8f2a3'; diff --git a/src/Symfony/Component/Validator/Constraints/Valid.php b/src/Symfony/Component/Validator/Constraints/Valid.php index fef8b2da9237..43cb6db0d922 100644 --- a/src/Symfony/Component/Validator/Constraints/Valid.php +++ b/src/Symfony/Component/Validator/Constraints/Valid.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] class Valid extends Constraint { public $traverse = true; From 55ecfec3e6a989b7b2a7388f36ac8cac5aa7e891 Mon Sep 17 00:00:00 2001 From: Artyum Petrov Date: Mon, 29 Aug 2022 20:34:49 +0400 Subject: [PATCH 02/12] Added ConstraintAttributeListener --- .../Resources/config/validator.php | 7 ++ .../ConstraintAttributeListener.php | 69 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php index 3fd066ee37f1..60dbf89e2825 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php @@ -18,6 +18,7 @@ use Symfony\Component\Validator\Constraints\ExpressionValidator; use Symfony\Component\Validator\Constraints\NotCompromisedPasswordValidator; use Symfony\Component\Validator\ContainerConstraintValidatorFactory; +use Symfony\Component\Validator\EventListener\ConstraintAttributeListener; use Symfony\Component\Validator\Mapping\Loader\PropertyInfoLoader; use Symfony\Component\Validator\Validation; use Symfony\Component\Validator\Validator\ValidatorInterface; @@ -102,5 +103,11 @@ service('property_info'), ]) ->tag('validator.auto_mapper') + + ->set('controller.is_granted_attribute_listener', ConstraintAttributeListener::class) + ->args([ + service('validator'), + ]) + ->tag('kernel.event_subscriber') ; }; diff --git a/src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php b/src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php new file mode 100644 index 000000000000..7e6b6aa75ca3 --- /dev/null +++ b/src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\EventListener; + +use Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ValidationFailedException; +use Symfony\Component\Validator\Validator\ValidatorInterface; + +/** + * Handles the validator constraint attributes on controller's arguments. + * + * @author Dynèsh Hassanaly + */ +class ConstraintAttributeListener +{ + public function __construct(private readonly ValidatorInterface $validator) { + } + + private function getReflectionMethod(callable $controller): \ReflectionMethod + { + if (is_array($controller)) { + $class = $controller[0]; + $method = $controller[1]; + } else { + /** @var object $controller */ + $class = $controller; + $method = '__invoke'; + } + + return new \ReflectionMethod($class, $method); + } + + public function onKernelControllerArguments(ControllerArgumentsEvent $event): void + { + $controller = $event->getController(); + $arguments = $event->getArguments(); + $reflectionMethod = $this->getReflectionMethod($controller); + + foreach ($reflectionMethod->getParameters() as $index => $reflectionParameter) { + $reflectionAttributes = $reflectionParameter->getAttributes(Constraint::class, \ReflectionAttribute::IS_INSTANCEOF); + + if (!$reflectionAttributes) { + continue; + } + + foreach ($reflectionAttributes as $reflectionAttribute) { + /** @var Constraint $constraint */ + $constraint = $reflectionAttribute->newInstance(); + $value = $arguments[$index]; + + $violations = $this->validator->validate($value, $constraint); + + if ($violations->count() > 0) { + throw new ValidationFailedException($value, $violations); + } + } + } + } +} From 3de11419252dbdf2e443ecc257a28c2ac6ddd542 Mon Sep 17 00:00:00 2001 From: Artyum Petrov Date: Mon, 29 Aug 2022 21:29:17 +0400 Subject: [PATCH 03/12] Implemented EventSubscriberInterface in ConstraintAttributeListener --- .../ConstraintAttributeListener.php | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php b/src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php index 7e6b6aa75ca3..4cbf374a3be8 100644 --- a/src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php +++ b/src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php @@ -11,7 +11,9 @@ namespace Symfony\Component\Validator\EventListener; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent; +use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ValidationFailedException; use Symfony\Component\Validator\Validator\ValidatorInterface; @@ -21,25 +23,11 @@ * * @author Dynèsh Hassanaly */ -class ConstraintAttributeListener +class ConstraintAttributeListener implements EventSubscriberInterface { public function __construct(private readonly ValidatorInterface $validator) { } - private function getReflectionMethod(callable $controller): \ReflectionMethod - { - if (is_array($controller)) { - $class = $controller[0]; - $method = $controller[1]; - } else { - /** @var object $controller */ - $class = $controller; - $method = '__invoke'; - } - - return new \ReflectionMethod($class, $method); - } - public function onKernelControllerArguments(ControllerArgumentsEvent $event): void { $controller = $event->getController(); @@ -66,4 +54,23 @@ public function onKernelControllerArguments(ControllerArgumentsEvent $event): vo } } } + + public static function getSubscribedEvents(): array + { + return [KernelEvents::CONTROLLER_ARGUMENTS => ['onKernelControllerArguments', 10]]; + } + + private function getReflectionMethod(callable $controller): \ReflectionMethod + { + if (is_array($controller)) { + $class = $controller[0]; + $method = $controller[1]; + } else { + /** @var object $controller */ + $class = $controller; + $method = '__invoke'; + } + + return new \ReflectionMethod($class, $method); + } } From da6c36837b08e17c75dc481d07cb9c2cd44ed5eb Mon Sep 17 00:00:00 2001 From: Artyum Petrov Date: Mon, 29 Aug 2022 21:30:20 +0400 Subject: [PATCH 04/12] Fixed wrong service id in validator.php for ConstraintAttributeListener --- .../Bundle/FrameworkBundle/Resources/config/validator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php index 60dbf89e2825..dcd913bed2e0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php @@ -26,7 +26,8 @@ return static function (ContainerConfigurator $container) { $container->parameters() - ->set('validator.mapping.cache.file', param('kernel.cache_dir').'/validation.php'); + ->set('validator.mapping.cache.file', param('kernel.cache_dir').'/validation.php') + ; $container->services() ->set('validator', ValidatorInterface::class) @@ -104,7 +105,7 @@ ]) ->tag('validator.auto_mapper') - ->set('controller.is_granted_attribute_listener', ConstraintAttributeListener::class) + ->set('controller.constraint_attribute_listener', ConstraintAttributeListener::class) ->args([ service('validator'), ]) From f5c12527e2a275b1b0747d1a81a507db492500d8 Mon Sep 17 00:00:00 2001 From: Artyum Petrov Date: Mon, 29 Aug 2022 23:22:51 +0400 Subject: [PATCH 05/12] Updated CHANGELOG.md --- src/Symfony/Component/Validator/CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Symfony/Component/Validator/CHANGELOG.md b/src/Symfony/Component/Validator/CHANGELOG.md index 6d77264d9ae5..d3f4704546bc 100644 --- a/src/Symfony/Component/Validator/CHANGELOG.md +++ b/src/Symfony/Component/Validator/CHANGELOG.md @@ -6,6 +6,17 @@ CHANGELOG * Deprecate the "loose" e-mail validation mode, use "html5" instead * Add the `negate` option to the `Expression` constraint, to inverse the logic of the violation's creation + * Allow the following constraints to be used in method parameters: + `All`, `AtLeastOneOf`, `Bic`, `Blank`, `Callback`, `CardScheme`, `Choice`, + `Cidr`, `Collection`, `Count`, `Country`, `CssColor`, `Currency`, `Date`, + `DateTime`, `DivisibleBy`, `Email`, `EqualTo`, `Expression`, `ExpressionSyntax`, + `File`, `GreaterThan`, `GreaterThanOrEqual`, `Hostname`, `Iban`, `IdenticalTo`, + `Image`, `Ip`, `Isbn`, `IsFalse`, `Isin`, `IsNull`, `Issn`, `IsTrue`, `Json`, + `Language`, `Length`, `LessThan`, `LessThanOrEqual`, `Locale`, `Luhn`, `Negative`, + `NegativeOrZero`, `NotBlank`, `NotCompromisedPassword`, `NotEqualTo`, `NotIdenticalTo`, + `NotNull`, `Positive`, `PositiveOrZero`, `Range`, `Regex`, `Sequentially`, `Time`, + `Timezone`, `Type`, `Ulid`, `Unique`, `Url`, `Uuid`, `Valid` + * Add the `ConstraintAttributeListener` to validate the controller arguments 6.1 --- From f01d56b2e95424441d7a8ca2ea0d6476d28a590e Mon Sep 17 00:00:00 2001 From: Artyum Petrov Date: Wed, 31 Aug 2022 22:53:11 +0400 Subject: [PATCH 06/12] Revert "Updated CHANGELOG.md" This reverts commit f5c12527e2a275b1b0747d1a81a507db492500d8. --- src/Symfony/Component/Validator/CHANGELOG.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/Symfony/Component/Validator/CHANGELOG.md b/src/Symfony/Component/Validator/CHANGELOG.md index d3f4704546bc..6d77264d9ae5 100644 --- a/src/Symfony/Component/Validator/CHANGELOG.md +++ b/src/Symfony/Component/Validator/CHANGELOG.md @@ -6,17 +6,6 @@ CHANGELOG * Deprecate the "loose" e-mail validation mode, use "html5" instead * Add the `negate` option to the `Expression` constraint, to inverse the logic of the violation's creation - * Allow the following constraints to be used in method parameters: - `All`, `AtLeastOneOf`, `Bic`, `Blank`, `Callback`, `CardScheme`, `Choice`, - `Cidr`, `Collection`, `Count`, `Country`, `CssColor`, `Currency`, `Date`, - `DateTime`, `DivisibleBy`, `Email`, `EqualTo`, `Expression`, `ExpressionSyntax`, - `File`, `GreaterThan`, `GreaterThanOrEqual`, `Hostname`, `Iban`, `IdenticalTo`, - `Image`, `Ip`, `Isbn`, `IsFalse`, `Isin`, `IsNull`, `Issn`, `IsTrue`, `Json`, - `Language`, `Length`, `LessThan`, `LessThanOrEqual`, `Locale`, `Luhn`, `Negative`, - `NegativeOrZero`, `NotBlank`, `NotCompromisedPassword`, `NotEqualTo`, `NotIdenticalTo`, - `NotNull`, `Positive`, `PositiveOrZero`, `Range`, `Regex`, `Sequentially`, `Time`, - `Timezone`, `Type`, `Ulid`, `Unique`, `Url`, `Uuid`, `Valid` - * Add the `ConstraintAttributeListener` to validate the controller arguments 6.1 --- From 6df2a74971e7bc3fc3fb8ff6b7c49b2eb0bdb5ce Mon Sep 17 00:00:00 2001 From: Artyum Petrov Date: Wed, 31 Aug 2022 22:53:24 +0400 Subject: [PATCH 07/12] Revert "Added the \Attribute::TARGET_PARAMETER constant to almost all constraints" This reverts commit 465d9aa26de67f872ed2ead29f99ee828c95d208. --- src/Symfony/Component/Validator/Constraints/All.php | 2 +- src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php | 2 +- src/Symfony/Component/Validator/Constraints/Bic.php | 2 +- src/Symfony/Component/Validator/Constraints/Blank.php | 2 +- src/Symfony/Component/Validator/Constraints/Callback.php | 2 +- src/Symfony/Component/Validator/Constraints/CardScheme.php | 2 +- src/Symfony/Component/Validator/Constraints/Choice.php | 2 +- src/Symfony/Component/Validator/Constraints/Cidr.php | 2 +- src/Symfony/Component/Validator/Constraints/Collection.php | 2 +- src/Symfony/Component/Validator/Constraints/Count.php | 2 +- src/Symfony/Component/Validator/Constraints/Country.php | 2 +- src/Symfony/Component/Validator/Constraints/CssColor.php | 2 +- src/Symfony/Component/Validator/Constraints/Currency.php | 2 +- src/Symfony/Component/Validator/Constraints/Date.php | 2 +- src/Symfony/Component/Validator/Constraints/DateTime.php | 2 +- src/Symfony/Component/Validator/Constraints/DivisibleBy.php | 2 +- src/Symfony/Component/Validator/Constraints/Email.php | 2 +- src/Symfony/Component/Validator/Constraints/EqualTo.php | 2 +- src/Symfony/Component/Validator/Constraints/Expression.php | 2 +- .../Component/Validator/Constraints/ExpressionSyntax.php | 2 +- src/Symfony/Component/Validator/Constraints/File.php | 2 +- src/Symfony/Component/Validator/Constraints/GreaterThan.php | 2 +- .../Component/Validator/Constraints/GreaterThanOrEqual.php | 2 +- src/Symfony/Component/Validator/Constraints/Hostname.php | 2 +- src/Symfony/Component/Validator/Constraints/Iban.php | 2 +- src/Symfony/Component/Validator/Constraints/IdenticalTo.php | 2 +- src/Symfony/Component/Validator/Constraints/Image.php | 2 +- src/Symfony/Component/Validator/Constraints/Ip.php | 2 +- src/Symfony/Component/Validator/Constraints/IsFalse.php | 2 +- src/Symfony/Component/Validator/Constraints/IsNull.php | 2 +- src/Symfony/Component/Validator/Constraints/IsTrue.php | 2 +- src/Symfony/Component/Validator/Constraints/Isbn.php | 2 +- src/Symfony/Component/Validator/Constraints/Isin.php | 2 +- src/Symfony/Component/Validator/Constraints/Issn.php | 2 +- src/Symfony/Component/Validator/Constraints/Json.php | 2 +- src/Symfony/Component/Validator/Constraints/Language.php | 2 +- src/Symfony/Component/Validator/Constraints/Length.php | 2 +- src/Symfony/Component/Validator/Constraints/LessThan.php | 2 +- src/Symfony/Component/Validator/Constraints/LessThanOrEqual.php | 2 +- src/Symfony/Component/Validator/Constraints/Locale.php | 2 +- src/Symfony/Component/Validator/Constraints/Luhn.php | 2 +- src/Symfony/Component/Validator/Constraints/Negative.php | 2 +- src/Symfony/Component/Validator/Constraints/NegativeOrZero.php | 2 +- src/Symfony/Component/Validator/Constraints/NotBlank.php | 2 +- .../Component/Validator/Constraints/NotCompromisedPassword.php | 2 +- src/Symfony/Component/Validator/Constraints/NotEqualTo.php | 2 +- src/Symfony/Component/Validator/Constraints/NotIdenticalTo.php | 2 +- src/Symfony/Component/Validator/Constraints/NotNull.php | 2 +- src/Symfony/Component/Validator/Constraints/Positive.php | 2 +- src/Symfony/Component/Validator/Constraints/PositiveOrZero.php | 2 +- src/Symfony/Component/Validator/Constraints/Range.php | 2 +- src/Symfony/Component/Validator/Constraints/Regex.php | 2 +- src/Symfony/Component/Validator/Constraints/Sequentially.php | 2 +- src/Symfony/Component/Validator/Constraints/Time.php | 2 +- src/Symfony/Component/Validator/Constraints/Timezone.php | 2 +- src/Symfony/Component/Validator/Constraints/Type.php | 2 +- src/Symfony/Component/Validator/Constraints/Ulid.php | 2 +- src/Symfony/Component/Validator/Constraints/Unique.php | 2 +- src/Symfony/Component/Validator/Constraints/Url.php | 2 +- src/Symfony/Component/Validator/Constraints/Uuid.php | 2 +- src/Symfony/Component/Validator/Constraints/Valid.php | 2 +- 61 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/Symfony/Component/Validator/Constraints/All.php b/src/Symfony/Component/Validator/Constraints/All.php index e6fc3e820e48..1461b0348e8a 100644 --- a/src/Symfony/Component/Validator/Constraints/All.php +++ b/src/Symfony/Component/Validator/Constraints/All.php @@ -17,7 +17,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class All extends Composite { public $constraints = []; diff --git a/src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php b/src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php index 282ff877e4de..33ed343af7ae 100644 --- a/src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php +++ b/src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php @@ -17,7 +17,7 @@ * * @author Przemysław Bogusz */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class AtLeastOneOf extends Composite { public const AT_LEAST_ONE_OF_ERROR = 'f27e6d6c-261a-4056-b391-6673a623531c'; diff --git a/src/Symfony/Component/Validator/Constraints/Bic.php b/src/Symfony/Component/Validator/Constraints/Bic.php index f76ef793ec27..dad4258dc0b6 100644 --- a/src/Symfony/Component/Validator/Constraints/Bic.php +++ b/src/Symfony/Component/Validator/Constraints/Bic.php @@ -23,7 +23,7 @@ * * @author Michael Hirschler */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Bic extends Constraint { public const INVALID_LENGTH_ERROR = '66dad313-af0b-4214-8566-6c799be9789c'; diff --git a/src/Symfony/Component/Validator/Constraints/Blank.php b/src/Symfony/Component/Validator/Constraints/Blank.php index 23958244697d..bd28e68bc81f 100644 --- a/src/Symfony/Component/Validator/Constraints/Blank.php +++ b/src/Symfony/Component/Validator/Constraints/Blank.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Blank extends Constraint { public const NOT_BLANK_ERROR = '183ad2de-533d-4796-a439-6d3c3852b549'; diff --git a/src/Symfony/Component/Validator/Constraints/Callback.php b/src/Symfony/Component/Validator/Constraints/Callback.php index e7804ad62047..82f67962b257 100644 --- a/src/Symfony/Component/Validator/Constraints/Callback.php +++ b/src/Symfony/Component/Validator/Constraints/Callback.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Callback extends Constraint { /** diff --git a/src/Symfony/Component/Validator/Constraints/CardScheme.php b/src/Symfony/Component/Validator/Constraints/CardScheme.php index 87c36a9abf7c..067024769aea 100644 --- a/src/Symfony/Component/Validator/Constraints/CardScheme.php +++ b/src/Symfony/Component/Validator/Constraints/CardScheme.php @@ -22,7 +22,7 @@ * @author Tim Nagel * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class CardScheme extends Constraint { public const AMEX = 'AMEX'; diff --git a/src/Symfony/Component/Validator/Constraints/Choice.php b/src/Symfony/Component/Validator/Constraints/Choice.php index bea42c580d59..5544688d0baf 100644 --- a/src/Symfony/Component/Validator/Constraints/Choice.php +++ b/src/Symfony/Component/Validator/Constraints/Choice.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Choice extends Constraint { public const NO_SUCH_CHOICE_ERROR = '8e179f1b-97aa-4560-a02f-2a8b42e49df7'; diff --git a/src/Symfony/Component/Validator/Constraints/Cidr.php b/src/Symfony/Component/Validator/Constraints/Cidr.php index 9e375ea46439..c40669e824db 100644 --- a/src/Symfony/Component/Validator/Constraints/Cidr.php +++ b/src/Symfony/Component/Validator/Constraints/Cidr.php @@ -23,7 +23,7 @@ * @author Sorin Pop * @author Calin Bolea */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Cidr extends Constraint { public const INVALID_CIDR_ERROR = '5649e53a-5afb-47c5-a360-ffbab3be8567'; diff --git a/src/Symfony/Component/Validator/Constraints/Collection.php b/src/Symfony/Component/Validator/Constraints/Collection.php index 9de56f761767..e02bd1457d23 100644 --- a/src/Symfony/Component/Validator/Constraints/Collection.php +++ b/src/Symfony/Component/Validator/Constraints/Collection.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Collection extends Composite { public const MISSING_FIELD_ERROR = '2fa2158c-2a7f-484b-98aa-975522539ff8'; diff --git a/src/Symfony/Component/Validator/Constraints/Count.php b/src/Symfony/Component/Validator/Constraints/Count.php index 76fa9672ef3f..ea5d4182865d 100644 --- a/src/Symfony/Component/Validator/Constraints/Count.php +++ b/src/Symfony/Component/Validator/Constraints/Count.php @@ -20,7 +20,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Count extends Constraint { public const TOO_FEW_ERROR = 'bef8e338-6ae5-4caf-b8e2-50e7b0579e69'; diff --git a/src/Symfony/Component/Validator/Constraints/Country.php b/src/Symfony/Component/Validator/Constraints/Country.php index b38ac6604f9e..03df0206bbed 100644 --- a/src/Symfony/Component/Validator/Constraints/Country.php +++ b/src/Symfony/Component/Validator/Constraints/Country.php @@ -21,7 +21,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Country extends Constraint { public const NO_SUCH_COUNTRY_ERROR = '8f900c12-61bd-455d-9398-996cd040f7f0'; diff --git a/src/Symfony/Component/Validator/Constraints/CssColor.php b/src/Symfony/Component/Validator/Constraints/CssColor.php index 1a018f72151b..d1e2e2783430 100644 --- a/src/Symfony/Component/Validator/Constraints/CssColor.php +++ b/src/Symfony/Component/Validator/Constraints/CssColor.php @@ -20,7 +20,7 @@ * * @author Mathieu Santostefano */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class CssColor extends Constraint { public const HEX_LONG = 'hex_long'; diff --git a/src/Symfony/Component/Validator/Constraints/Currency.php b/src/Symfony/Component/Validator/Constraints/Currency.php index 5db4e5d71cd0..5713d803e8cd 100644 --- a/src/Symfony/Component/Validator/Constraints/Currency.php +++ b/src/Symfony/Component/Validator/Constraints/Currency.php @@ -22,7 +22,7 @@ * @author Miha Vrhovnik * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Currency extends Constraint { public const NO_SUCH_CURRENCY_ERROR = '69945ac1-2db4-405f-bec7-d2772f73df52'; diff --git a/src/Symfony/Component/Validator/Constraints/Date.php b/src/Symfony/Component/Validator/Constraints/Date.php index 4be29305c1e5..1ca3bee11f35 100644 --- a/src/Symfony/Component/Validator/Constraints/Date.php +++ b/src/Symfony/Component/Validator/Constraints/Date.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Date extends Constraint { public const INVALID_FORMAT_ERROR = '69819696-02ac-4a99-9ff0-14e127c4d1bc'; diff --git a/src/Symfony/Component/Validator/Constraints/DateTime.php b/src/Symfony/Component/Validator/Constraints/DateTime.php index 465b83024594..f187f8b26685 100644 --- a/src/Symfony/Component/Validator/Constraints/DateTime.php +++ b/src/Symfony/Component/Validator/Constraints/DateTime.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class DateTime extends Constraint { public const INVALID_FORMAT_ERROR = '1a9da513-2640-4f84-9b6a-4d99dcddc628'; diff --git a/src/Symfony/Component/Validator/Constraints/DivisibleBy.php b/src/Symfony/Component/Validator/Constraints/DivisibleBy.php index 06a73f41c6c5..90164aab286b 100644 --- a/src/Symfony/Component/Validator/Constraints/DivisibleBy.php +++ b/src/Symfony/Component/Validator/Constraints/DivisibleBy.php @@ -17,7 +17,7 @@ * * @author Colin O'Dell */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class DivisibleBy extends AbstractComparison { public const NOT_DIVISIBLE_BY = '6d99d6c3-1464-4ccf-bdc7-14d083cf455c'; diff --git a/src/Symfony/Component/Validator/Constraints/Email.php b/src/Symfony/Component/Validator/Constraints/Email.php index 3aae4dce9b47..4340e7a7217d 100644 --- a/src/Symfony/Component/Validator/Constraints/Email.php +++ b/src/Symfony/Component/Validator/Constraints/Email.php @@ -22,7 +22,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Email extends Constraint { public const VALIDATION_MODE_HTML5 = 'html5'; diff --git a/src/Symfony/Component/Validator/Constraints/EqualTo.php b/src/Symfony/Component/Validator/Constraints/EqualTo.php index 5481f6f12df0..03769ce8a84a 100644 --- a/src/Symfony/Component/Validator/Constraints/EqualTo.php +++ b/src/Symfony/Component/Validator/Constraints/EqualTo.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class EqualTo extends AbstractComparison { public const NOT_EQUAL_ERROR = '478618a7-95ba-473d-9101-cabd45e49115'; diff --git a/src/Symfony/Component/Validator/Constraints/Expression.php b/src/Symfony/Component/Validator/Constraints/Expression.php index 92daf0243868..089b4f8903e5 100644 --- a/src/Symfony/Component/Validator/Constraints/Expression.php +++ b/src/Symfony/Component/Validator/Constraints/Expression.php @@ -23,7 +23,7 @@ * @author Fabien Potencier * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] class Expression extends Constraint { public const EXPRESSION_FAILED_ERROR = '6b3befbc-2f01-4ddf-be21-b57898905284'; diff --git a/src/Symfony/Component/Validator/Constraints/ExpressionSyntax.php b/src/Symfony/Component/Validator/Constraints/ExpressionSyntax.php index 94eb38476cd3..a614ae43fc6f 100644 --- a/src/Symfony/Component/Validator/Constraints/ExpressionSyntax.php +++ b/src/Symfony/Component/Validator/Constraints/ExpressionSyntax.php @@ -19,7 +19,7 @@ * * @author Andrey Sevastianov */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class ExpressionSyntax extends Constraint { public const EXPRESSION_SYNTAX_ERROR = 'e219aa22-8b11-48ec-81a0-fc07cdb0e13f'; diff --git a/src/Symfony/Component/Validator/Constraints/File.php b/src/Symfony/Component/Validator/Constraints/File.php index 0a75d154e1e2..009251df4d4b 100644 --- a/src/Symfony/Component/Validator/Constraints/File.php +++ b/src/Symfony/Component/Validator/Constraints/File.php @@ -22,7 +22,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class File extends Constraint { // Check the Image constraint for clashes if adding new constants here diff --git a/src/Symfony/Component/Validator/Constraints/GreaterThan.php b/src/Symfony/Component/Validator/Constraints/GreaterThan.php index 81570ee664e0..ce56f1ac1c81 100644 --- a/src/Symfony/Component/Validator/Constraints/GreaterThan.php +++ b/src/Symfony/Component/Validator/Constraints/GreaterThan.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class GreaterThan extends AbstractComparison { public const TOO_LOW_ERROR = '778b7ae0-84d3-481a-9dec-35fdb64b1d78'; diff --git a/src/Symfony/Component/Validator/Constraints/GreaterThanOrEqual.php b/src/Symfony/Component/Validator/Constraints/GreaterThanOrEqual.php index 30060a136cbc..c962f7964f4b 100644 --- a/src/Symfony/Component/Validator/Constraints/GreaterThanOrEqual.php +++ b/src/Symfony/Component/Validator/Constraints/GreaterThanOrEqual.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class GreaterThanOrEqual extends AbstractComparison { public const TOO_LOW_ERROR = 'ea4e51d1-3342-48bd-87f1-9e672cd90cad'; diff --git a/src/Symfony/Component/Validator/Constraints/Hostname.php b/src/Symfony/Component/Validator/Constraints/Hostname.php index 744cc046d078..cbf33cd8d027 100644 --- a/src/Symfony/Component/Validator/Constraints/Hostname.php +++ b/src/Symfony/Component/Validator/Constraints/Hostname.php @@ -19,7 +19,7 @@ * * @author Dmitrii Poddubnyi */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Hostname extends Constraint { public const INVALID_HOSTNAME_ERROR = '7057ffdb-0af4-4f7e-bd5e-e9acfa6d7a2d'; diff --git a/src/Symfony/Component/Validator/Constraints/Iban.php b/src/Symfony/Component/Validator/Constraints/Iban.php index 50e6a175f394..684df2e561e5 100644 --- a/src/Symfony/Component/Validator/Constraints/Iban.php +++ b/src/Symfony/Component/Validator/Constraints/Iban.php @@ -21,7 +21,7 @@ * @author Michael Schummel * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Iban extends Constraint { public const INVALID_COUNTRY_CODE_ERROR = 'de78ee2c-bd50-44e2-aec8-3d8228aeadb9'; diff --git a/src/Symfony/Component/Validator/Constraints/IdenticalTo.php b/src/Symfony/Component/Validator/Constraints/IdenticalTo.php index b84876ebb3d9..50ec5e1297a1 100644 --- a/src/Symfony/Component/Validator/Constraints/IdenticalTo.php +++ b/src/Symfony/Component/Validator/Constraints/IdenticalTo.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class IdenticalTo extends AbstractComparison { public const NOT_IDENTICAL_ERROR = '2a8cc50f-58a2-4536-875e-060a2ce69ed5'; diff --git a/src/Symfony/Component/Validator/Constraints/Image.php b/src/Symfony/Component/Validator/Constraints/Image.php index fcc0ece64dc7..0a569c710248 100644 --- a/src/Symfony/Component/Validator/Constraints/Image.php +++ b/src/Symfony/Component/Validator/Constraints/Image.php @@ -18,7 +18,7 @@ * @author Benjamin Dulau * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Image extends File { public const SIZE_NOT_DETECTED_ERROR = '6d55c3f4-e58e-4fe3-91ee-74b492199956'; diff --git a/src/Symfony/Component/Validator/Constraints/Ip.php b/src/Symfony/Component/Validator/Constraints/Ip.php index 47f50404bb9a..94c4ca484766 100644 --- a/src/Symfony/Component/Validator/Constraints/Ip.php +++ b/src/Symfony/Component/Validator/Constraints/Ip.php @@ -24,7 +24,7 @@ * @author Bernhard Schussek * @author Joseph Bielawski */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Ip extends Constraint { public const V4 = '4'; diff --git a/src/Symfony/Component/Validator/Constraints/IsFalse.php b/src/Symfony/Component/Validator/Constraints/IsFalse.php index 19a9a199c708..26042e2ee12b 100644 --- a/src/Symfony/Component/Validator/Constraints/IsFalse.php +++ b/src/Symfony/Component/Validator/Constraints/IsFalse.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class IsFalse extends Constraint { public const NOT_FALSE_ERROR = 'd53a91b0-def3-426a-83d7-269da7ab4200'; diff --git a/src/Symfony/Component/Validator/Constraints/IsNull.php b/src/Symfony/Component/Validator/Constraints/IsNull.php index 1ea7a489fabc..5084c268a1d7 100644 --- a/src/Symfony/Component/Validator/Constraints/IsNull.php +++ b/src/Symfony/Component/Validator/Constraints/IsNull.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class IsNull extends Constraint { public const NOT_NULL_ERROR = '60d2f30b-8cfa-4372-b155-9656634de120'; diff --git a/src/Symfony/Component/Validator/Constraints/IsTrue.php b/src/Symfony/Component/Validator/Constraints/IsTrue.php index 86607735519f..8ee9f729d04d 100644 --- a/src/Symfony/Component/Validator/Constraints/IsTrue.php +++ b/src/Symfony/Component/Validator/Constraints/IsTrue.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class IsTrue extends Constraint { public const NOT_TRUE_ERROR = '2beabf1c-54c0-4882-a928-05249b26e23b'; diff --git a/src/Symfony/Component/Validator/Constraints/Isbn.php b/src/Symfony/Component/Validator/Constraints/Isbn.php index bcf3bb33eb98..5b70c6fcbdc4 100644 --- a/src/Symfony/Component/Validator/Constraints/Isbn.php +++ b/src/Symfony/Component/Validator/Constraints/Isbn.php @@ -21,7 +21,7 @@ * @author Manuel Reinhard * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Isbn extends Constraint { public const ISBN_10 = 'isbn10'; diff --git a/src/Symfony/Component/Validator/Constraints/Isin.php b/src/Symfony/Component/Validator/Constraints/Isin.php index a3dfcc5dc206..1522044befa8 100644 --- a/src/Symfony/Component/Validator/Constraints/Isin.php +++ b/src/Symfony/Component/Validator/Constraints/Isin.php @@ -19,7 +19,7 @@ * * @author Laurent Masforné */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Isin extends Constraint { public const VALIDATION_LENGTH = 12; diff --git a/src/Symfony/Component/Validator/Constraints/Issn.php b/src/Symfony/Component/Validator/Constraints/Issn.php index b65ebf70c7f9..a11f022e63e1 100644 --- a/src/Symfony/Component/Validator/Constraints/Issn.php +++ b/src/Symfony/Component/Validator/Constraints/Issn.php @@ -20,7 +20,7 @@ * @author Antonio J. García Lagar * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Issn extends Constraint { public const TOO_SHORT_ERROR = '6a20dd3d-f463-4460-8e7b-18a1b98abbfb'; diff --git a/src/Symfony/Component/Validator/Constraints/Json.php b/src/Symfony/Component/Validator/Constraints/Json.php index 9c68e3fe019d..f2826d28e39b 100644 --- a/src/Symfony/Component/Validator/Constraints/Json.php +++ b/src/Symfony/Component/Validator/Constraints/Json.php @@ -19,7 +19,7 @@ * * @author Imad ZAIRIG */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Json extends Constraint { public const INVALID_JSON_ERROR = '0789c8ad-2d2b-49a4-8356-e2ce63998504'; diff --git a/src/Symfony/Component/Validator/Constraints/Language.php b/src/Symfony/Component/Validator/Constraints/Language.php index 7dc5b8764f9b..e3c2ce9629dd 100644 --- a/src/Symfony/Component/Validator/Constraints/Language.php +++ b/src/Symfony/Component/Validator/Constraints/Language.php @@ -21,7 +21,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Language extends Constraint { public const NO_SUCH_LANGUAGE_ERROR = 'ee65fec4-9a20-4202-9f39-ca558cd7bdf7'; diff --git a/src/Symfony/Component/Validator/Constraints/Length.php b/src/Symfony/Component/Validator/Constraints/Length.php index 232d164cdc6f..a25bf520ea60 100644 --- a/src/Symfony/Component/Validator/Constraints/Length.php +++ b/src/Symfony/Component/Validator/Constraints/Length.php @@ -21,7 +21,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Length extends Constraint { public const TOO_SHORT_ERROR = '9ff3fdc4-b214-49db-8718-39c315e33d45'; diff --git a/src/Symfony/Component/Validator/Constraints/LessThan.php b/src/Symfony/Component/Validator/Constraints/LessThan.php index 5aed52400d95..cf4144d6d26d 100644 --- a/src/Symfony/Component/Validator/Constraints/LessThan.php +++ b/src/Symfony/Component/Validator/Constraints/LessThan.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class LessThan extends AbstractComparison { public const TOO_HIGH_ERROR = '079d7420-2d13-460c-8756-de810eeb37d2'; diff --git a/src/Symfony/Component/Validator/Constraints/LessThanOrEqual.php b/src/Symfony/Component/Validator/Constraints/LessThanOrEqual.php index 9406eb0f31c5..84e31abfc021 100644 --- a/src/Symfony/Component/Validator/Constraints/LessThanOrEqual.php +++ b/src/Symfony/Component/Validator/Constraints/LessThanOrEqual.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class LessThanOrEqual extends AbstractComparison { public const TOO_HIGH_ERROR = '30fbb013-d015-4232-8b3b-8f3be97a7e14'; diff --git a/src/Symfony/Component/Validator/Constraints/Locale.php b/src/Symfony/Component/Validator/Constraints/Locale.php index bfa4ebded01b..30f0ffd6eb30 100644 --- a/src/Symfony/Component/Validator/Constraints/Locale.php +++ b/src/Symfony/Component/Validator/Constraints/Locale.php @@ -21,7 +21,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Locale extends Constraint { public const NO_SUCH_LOCALE_ERROR = 'a0af4293-1f1a-4a1c-a328-979cba6182a2'; diff --git a/src/Symfony/Component/Validator/Constraints/Luhn.php b/src/Symfony/Component/Validator/Constraints/Luhn.php index a03f4cfe0754..198fb29baf29 100644 --- a/src/Symfony/Component/Validator/Constraints/Luhn.php +++ b/src/Symfony/Component/Validator/Constraints/Luhn.php @@ -23,7 +23,7 @@ * @author Greg Knapp http://gregk.me/2011/php-implementation-of-bank-card-luhn-algorithm/ * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Luhn extends Constraint { public const INVALID_CHARACTERS_ERROR = 'dfad6d23-1b74-4374-929b-5cbb56fc0d9e'; diff --git a/src/Symfony/Component/Validator/Constraints/Negative.php b/src/Symfony/Component/Validator/Constraints/Negative.php index 70370c92afa2..c13ebcb4a8b9 100644 --- a/src/Symfony/Component/Validator/Constraints/Negative.php +++ b/src/Symfony/Component/Validator/Constraints/Negative.php @@ -17,7 +17,7 @@ * * @author Jan Schädlich */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Negative extends LessThan { use ZeroComparisonConstraintTrait; diff --git a/src/Symfony/Component/Validator/Constraints/NegativeOrZero.php b/src/Symfony/Component/Validator/Constraints/NegativeOrZero.php index 97ec55948097..5be735c312da 100644 --- a/src/Symfony/Component/Validator/Constraints/NegativeOrZero.php +++ b/src/Symfony/Component/Validator/Constraints/NegativeOrZero.php @@ -17,7 +17,7 @@ * * @author Jan Schädlich */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class NegativeOrZero extends LessThanOrEqual { use ZeroComparisonConstraintTrait; diff --git a/src/Symfony/Component/Validator/Constraints/NotBlank.php b/src/Symfony/Component/Validator/Constraints/NotBlank.php index b40aa604a48a..38637ad20260 100644 --- a/src/Symfony/Component/Validator/Constraints/NotBlank.php +++ b/src/Symfony/Component/Validator/Constraints/NotBlank.php @@ -21,7 +21,7 @@ * @author Bernhard Schussek * @author Kévin Dunglas */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class NotBlank extends Constraint { public const IS_BLANK_ERROR = 'c1051bb4-d103-4f74-8988-acbcafc7fdc3'; diff --git a/src/Symfony/Component/Validator/Constraints/NotCompromisedPassword.php b/src/Symfony/Component/Validator/Constraints/NotCompromisedPassword.php index 806612880c29..3329d3c1abc0 100644 --- a/src/Symfony/Component/Validator/Constraints/NotCompromisedPassword.php +++ b/src/Symfony/Component/Validator/Constraints/NotCompromisedPassword.php @@ -21,7 +21,7 @@ * * @author Kévin Dunglas */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class NotCompromisedPassword extends Constraint { public const COMPROMISED_PASSWORD_ERROR = 'd9bcdbfe-a9d6-4bfa-a8ff-da5fd93e0f6d'; diff --git a/src/Symfony/Component/Validator/Constraints/NotEqualTo.php b/src/Symfony/Component/Validator/Constraints/NotEqualTo.php index 3da520b7eef1..9a5c07b21e2a 100644 --- a/src/Symfony/Component/Validator/Constraints/NotEqualTo.php +++ b/src/Symfony/Component/Validator/Constraints/NotEqualTo.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class NotEqualTo extends AbstractComparison { public const IS_EQUAL_ERROR = 'aa2e33da-25c8-4d76-8c6c-812f02ea89dd'; diff --git a/src/Symfony/Component/Validator/Constraints/NotIdenticalTo.php b/src/Symfony/Component/Validator/Constraints/NotIdenticalTo.php index 4e70982d5f52..206c10613732 100644 --- a/src/Symfony/Component/Validator/Constraints/NotIdenticalTo.php +++ b/src/Symfony/Component/Validator/Constraints/NotIdenticalTo.php @@ -18,7 +18,7 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class NotIdenticalTo extends AbstractComparison { public const IS_IDENTICAL_ERROR = '4aaac518-0dda-4129-a6d9-e216b9b454a0'; diff --git a/src/Symfony/Component/Validator/Constraints/NotNull.php b/src/Symfony/Component/Validator/Constraints/NotNull.php index eabd8044103f..2fd4123cdfca 100644 --- a/src/Symfony/Component/Validator/Constraints/NotNull.php +++ b/src/Symfony/Component/Validator/Constraints/NotNull.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class NotNull extends Constraint { public const IS_NULL_ERROR = 'ad32d13f-c3d4-423b-909a-857b961eb720'; diff --git a/src/Symfony/Component/Validator/Constraints/Positive.php b/src/Symfony/Component/Validator/Constraints/Positive.php index 643ac9560ca9..951e944c9a7e 100644 --- a/src/Symfony/Component/Validator/Constraints/Positive.php +++ b/src/Symfony/Component/Validator/Constraints/Positive.php @@ -17,7 +17,7 @@ * * @author Jan Schädlich */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Positive extends GreaterThan { use ZeroComparisonConstraintTrait; diff --git a/src/Symfony/Component/Validator/Constraints/PositiveOrZero.php b/src/Symfony/Component/Validator/Constraints/PositiveOrZero.php index 0a35a6112326..a7669c61070d 100644 --- a/src/Symfony/Component/Validator/Constraints/PositiveOrZero.php +++ b/src/Symfony/Component/Validator/Constraints/PositiveOrZero.php @@ -17,7 +17,7 @@ * * @author Jan Schädlich */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class PositiveOrZero extends GreaterThanOrEqual { use ZeroComparisonConstraintTrait; diff --git a/src/Symfony/Component/Validator/Constraints/Range.php b/src/Symfony/Component/Validator/Constraints/Range.php index 865fd1d56d37..ca5cba3c985a 100644 --- a/src/Symfony/Component/Validator/Constraints/Range.php +++ b/src/Symfony/Component/Validator/Constraints/Range.php @@ -23,7 +23,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Range extends Constraint { public const INVALID_CHARACTERS_ERROR = 'ad9a9798-7a99-4df7-8ce9-46e416a1e60b'; diff --git a/src/Symfony/Component/Validator/Constraints/Regex.php b/src/Symfony/Component/Validator/Constraints/Regex.php index 226f43e0b1ab..67dc8b37c67f 100644 --- a/src/Symfony/Component/Validator/Constraints/Regex.php +++ b/src/Symfony/Component/Validator/Constraints/Regex.php @@ -20,7 +20,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Regex extends Constraint { public const REGEX_FAILED_ERROR = 'de1e3db3-5ed4-4941-aae4-59f3667cc3a3'; diff --git a/src/Symfony/Component/Validator/Constraints/Sequentially.php b/src/Symfony/Component/Validator/Constraints/Sequentially.php index 172eae45b873..5eea1ebba439 100644 --- a/src/Symfony/Component/Validator/Constraints/Sequentially.php +++ b/src/Symfony/Component/Validator/Constraints/Sequentially.php @@ -20,7 +20,7 @@ * * @author Maxime Steinhausser */ -#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Sequentially extends Composite { public $constraints = []; diff --git a/src/Symfony/Component/Validator/Constraints/Time.php b/src/Symfony/Component/Validator/Constraints/Time.php index fbfeb6a1899f..f281ae1ee85b 100644 --- a/src/Symfony/Component/Validator/Constraints/Time.php +++ b/src/Symfony/Component/Validator/Constraints/Time.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Time extends Constraint { public const INVALID_FORMAT_ERROR = '9d27b2bb-f755-4fbf-b725-39b1edbdebdf'; diff --git a/src/Symfony/Component/Validator/Constraints/Timezone.php b/src/Symfony/Component/Validator/Constraints/Timezone.php index f4d5e8885b76..03bc19e7cc66 100644 --- a/src/Symfony/Component/Validator/Constraints/Timezone.php +++ b/src/Symfony/Component/Validator/Constraints/Timezone.php @@ -21,7 +21,7 @@ * @author Javier Spagnoletti * @author Hugo Hamon */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Timezone extends Constraint { public const TIMEZONE_IDENTIFIER_ERROR = '5ce113e6-5e64-4ea2-90fe-d2233956db13'; diff --git a/src/Symfony/Component/Validator/Constraints/Type.php b/src/Symfony/Component/Validator/Constraints/Type.php index ac512a8b4292..97a5ef939d3f 100644 --- a/src/Symfony/Component/Validator/Constraints/Type.php +++ b/src/Symfony/Component/Validator/Constraints/Type.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Type extends Constraint { public const INVALID_TYPE_ERROR = 'ba785a8c-82cb-4283-967c-3cf342181b40'; diff --git a/src/Symfony/Component/Validator/Constraints/Ulid.php b/src/Symfony/Component/Validator/Constraints/Ulid.php index e4a36e6cc83a..ece08c721cd7 100644 --- a/src/Symfony/Component/Validator/Constraints/Ulid.php +++ b/src/Symfony/Component/Validator/Constraints/Ulid.php @@ -18,7 +18,7 @@ * * @author Laurent Clouet */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Ulid extends Constraint { public const TOO_SHORT_ERROR = '7b44804e-37d5-4df4-9bdd-b738d4a45bb4'; diff --git a/src/Symfony/Component/Validator/Constraints/Unique.php b/src/Symfony/Component/Validator/Constraints/Unique.php index 53b091e97906..6db31c0e4123 100644 --- a/src/Symfony/Component/Validator/Constraints/Unique.php +++ b/src/Symfony/Component/Validator/Constraints/Unique.php @@ -20,7 +20,7 @@ * * @author Yevgeniy Zholkevskiy */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Unique extends Constraint { public const IS_NOT_UNIQUE = '7911c98d-b845-4da0-94b7-a8dac36bc55a'; diff --git a/src/Symfony/Component/Validator/Constraints/Url.php b/src/Symfony/Component/Validator/Constraints/Url.php index fa6c3fe2713a..e3bea2e1b3d6 100644 --- a/src/Symfony/Component/Validator/Constraints/Url.php +++ b/src/Symfony/Component/Validator/Constraints/Url.php @@ -20,7 +20,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Url extends Constraint { public const INVALID_URL_ERROR = '57c2f299-1154-4870-89bb-ef3b1f5ad229'; diff --git a/src/Symfony/Component/Validator/Constraints/Uuid.php b/src/Symfony/Component/Validator/Constraints/Uuid.php index 2e7bb0ccee5c..82b790578378 100644 --- a/src/Symfony/Component/Validator/Constraints/Uuid.php +++ b/src/Symfony/Component/Validator/Constraints/Uuid.php @@ -20,7 +20,7 @@ * @author Colin O'Dell * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Uuid extends Constraint { public const TOO_SHORT_ERROR = 'aa314679-dac9-4f54-bf97-b2049df8f2a3'; diff --git a/src/Symfony/Component/Validator/Constraints/Valid.php b/src/Symfony/Component/Validator/Constraints/Valid.php index 43cb6db0d922..fef8b2da9237 100644 --- a/src/Symfony/Component/Validator/Constraints/Valid.php +++ b/src/Symfony/Component/Validator/Constraints/Valid.php @@ -19,7 +19,7 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Valid extends Constraint { public $traverse = true; From 225b58edc3dacbf0e6b9926bcdbc798e82295ee1 Mon Sep 17 00:00:00 2001 From: Artyum Petrov Date: Wed, 31 Aug 2022 23:23:48 +0400 Subject: [PATCH 08/12] Added ControllerArgument constraint --- .../Constraints/ControllerArgument.php | 44 +++++++++++++++++++ .../ControllerArgumentValidator.php | 44 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 src/Symfony/Component/Validator/Constraints/ControllerArgument.php create mode 100644 src/Symfony/Component/Validator/Constraints/ControllerArgumentValidator.php diff --git a/src/Symfony/Component/Validator/Constraints/ControllerArgument.php b/src/Symfony/Component/Validator/Constraints/ControllerArgument.php new file mode 100644 index 000000000000..4dd4142ce135 --- /dev/null +++ b/src/Symfony/Component/Validator/Constraints/ControllerArgument.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @author Dynèsh Hassanaly + */ +#[\Attribute(\Attribute::TARGET_PARAMETER)] +class ControllerArgument extends Composite +{ + public $constraints = []; + + public function __construct(mixed $constraints = null, array $groups = null, mixed $payload = null) + { + parent::__construct($constraints ?? [], $groups, $payload); + } + + public function getDefaultOption(): ?string + { + return 'constraints'; + } + + public function getRequiredOptions(): array + { + return ['constraints']; + } + + /** + * @inheritDoc + */ + protected function getCompositeOption(): string + { + return 'constraints'; + } +} diff --git a/src/Symfony/Component/Validator/Constraints/ControllerArgumentValidator.php b/src/Symfony/Component/Validator/Constraints/ControllerArgumentValidator.php new file mode 100644 index 000000000000..696b28987591 --- /dev/null +++ b/src/Symfony/Component/Validator/Constraints/ControllerArgumentValidator.php @@ -0,0 +1,44 @@ + + * + * 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\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Dynèsh Hassanaly + */ +class ControllerArgumentValidator extends ConstraintValidator +{ + /** + * @inheritDoc + */ + public function validate(mixed $value, Constraint $constraint) + { + if (!$constraint instanceof ControllerArgument) { + throw new UnexpectedTypeException($constraint, ControllerArgument::class); + } + + if (null === $value) { + return; + } + + $context = $this->context; + $validator = $context->getValidator()->inContext($context); + + foreach ($constraint->constraints as $c) { + $validator->validate($value, $c); + } + } +} From caf3d31a35ac2147827ae3f440094cafe3504006 Mon Sep 17 00:00:00 2001 From: Artyum Petrov Date: Wed, 31 Aug 2022 23:26:47 +0400 Subject: [PATCH 09/12] Now using the new ControllerArgument constraint in ConstraintAttributeListener --- .../EventListener/ConstraintAttributeListener.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php b/src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php index 4cbf374a3be8..37d7a9bd1071 100644 --- a/src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php +++ b/src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php @@ -15,6 +15,7 @@ use Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\ControllerArgument; use Symfony\Component\Validator\Exception\ValidationFailedException; use Symfony\Component\Validator\Validator\ValidatorInterface; @@ -25,8 +26,7 @@ */ class ConstraintAttributeListener implements EventSubscriberInterface { - public function __construct(private readonly ValidatorInterface $validator) { - } + public function __construct(private readonly ValidatorInterface $validator) {} public function onKernelControllerArguments(ControllerArgumentsEvent $event): void { @@ -35,7 +35,7 @@ public function onKernelControllerArguments(ControllerArgumentsEvent $event): vo $reflectionMethod = $this->getReflectionMethod($controller); foreach ($reflectionMethod->getParameters() as $index => $reflectionParameter) { - $reflectionAttributes = $reflectionParameter->getAttributes(Constraint::class, \ReflectionAttribute::IS_INSTANCEOF); + $reflectionAttributes = $reflectionParameter->getAttributes(ControllerArgument::class); if (!$reflectionAttributes) { continue; @@ -45,7 +45,6 @@ public function onKernelControllerArguments(ControllerArgumentsEvent $event): vo /** @var Constraint $constraint */ $constraint = $reflectionAttribute->newInstance(); $value = $arguments[$index]; - $violations = $this->validator->validate($value, $constraint); if ($violations->count() > 0) { From c6924f8130aa0d453f7ccc545131bfd081d83967 Mon Sep 17 00:00:00 2001 From: Artyum Petrov Date: Wed, 31 Aug 2022 23:27:08 +0400 Subject: [PATCH 10/12] Renamed ConstraintAttributeListener to ControllerArgumentConstraintAttributeListener --- .../Bundle/FrameworkBundle/Resources/config/validator.php | 4 ++-- ....php => ControllerArgumentConstraintAttributeListener.php} | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/Symfony/Component/Validator/EventListener/{ConstraintAttributeListener.php => ControllerArgumentConstraintAttributeListener.php} (96%) diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php index dcd913bed2e0..bf2dbcba1c71 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php @@ -18,7 +18,7 @@ use Symfony\Component\Validator\Constraints\ExpressionValidator; use Symfony\Component\Validator\Constraints\NotCompromisedPasswordValidator; use Symfony\Component\Validator\ContainerConstraintValidatorFactory; -use Symfony\Component\Validator\EventListener\ConstraintAttributeListener; +use Symfony\Component\Validator\EventListener\ControllerArgumentConstraintAttributeListener; use Symfony\Component\Validator\Mapping\Loader\PropertyInfoLoader; use Symfony\Component\Validator\Validation; use Symfony\Component\Validator\Validator\ValidatorInterface; @@ -105,7 +105,7 @@ ]) ->tag('validator.auto_mapper') - ->set('controller.constraint_attribute_listener', ConstraintAttributeListener::class) + ->set('controller.constraint_attribute_listener', ControllerArgumentConstraintAttributeListener::class) ->args([ service('validator'), ]) diff --git a/src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php b/src/Symfony/Component/Validator/EventListener/ControllerArgumentConstraintAttributeListener.php similarity index 96% rename from src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php rename to src/Symfony/Component/Validator/EventListener/ControllerArgumentConstraintAttributeListener.php index 37d7a9bd1071..cffcdb0406a6 100644 --- a/src/Symfony/Component/Validator/EventListener/ConstraintAttributeListener.php +++ b/src/Symfony/Component/Validator/EventListener/ControllerArgumentConstraintAttributeListener.php @@ -24,7 +24,7 @@ * * @author Dynèsh Hassanaly */ -class ConstraintAttributeListener implements EventSubscriberInterface +class ControllerArgumentConstraintAttributeListener implements EventSubscriberInterface { public function __construct(private readonly ValidatorInterface $validator) {} From 34ed8a91f2eadff127e6aeb052c597afdaa44986 Mon Sep 17 00:00:00 2001 From: Artyum Petrov Date: Wed, 31 Aug 2022 23:44:12 +0400 Subject: [PATCH 11/12] Updated service id to match listener class name --- .../Bundle/FrameworkBundle/Resources/config/validator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php index bf2dbcba1c71..137805118dde 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.php @@ -105,7 +105,7 @@ ]) ->tag('validator.auto_mapper') - ->set('controller.constraint_attribute_listener', ControllerArgumentConstraintAttributeListener::class) + ->set('controller.controller_argument_constraint_attribute_listener', ControllerArgumentConstraintAttributeListener::class) ->args([ service('validator'), ]) From dff2f5b54fc6af31cdb4ca53d9f92c87043532f4 Mon Sep 17 00:00:00 2001 From: Artyum Petrov Date: Thu, 1 Sep 2022 00:02:46 +0400 Subject: [PATCH 12/12] Removed unneeded foreach() --- ...ollerArgumentConstraintAttributeListener.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Component/Validator/EventListener/ControllerArgumentConstraintAttributeListener.php b/src/Symfony/Component/Validator/EventListener/ControllerArgumentConstraintAttributeListener.php index cffcdb0406a6..b5d2e1b559b2 100644 --- a/src/Symfony/Component/Validator/EventListener/ControllerArgumentConstraintAttributeListener.php +++ b/src/Symfony/Component/Validator/EventListener/ControllerArgumentConstraintAttributeListener.php @@ -41,15 +41,16 @@ public function onKernelControllerArguments(ControllerArgumentsEvent $event): vo continue; } - foreach ($reflectionAttributes as $reflectionAttribute) { - /** @var Constraint $constraint */ - $constraint = $reflectionAttribute->newInstance(); - $value = $arguments[$index]; - $violations = $this->validator->validate($value, $constraint); + // this attribute cannot be repeated, so we will always one item in this array + $reflectionAttribute = $reflectionAttributes[0]; - if ($violations->count() > 0) { - throw new ValidationFailedException($value, $violations); - } + /** @var Constraint $constraint */ + $constraint = $reflectionAttribute->newInstance(); + $value = $arguments[$index]; + $violations = $this->validator->validate($value, $constraint); + + if ($violations->count() > 0) { + throw new ValidationFailedException($value, $violations); } } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy