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 1461b0348e8aa..e6fc3e820e480 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 33ed343af7aee..282ff877e4de2 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 dad4258dc0b60..f76ef793ec27f 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 bd28e68bc81f5..23958244697de 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 82f67962b2572..e7804ad620471 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 067024769aea7..87c36a9abf7c7 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 5544688d0baf6..bea42c580d595 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 c40669e824dba..9e375ea46439f 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 e02bd1457d235..9de56f761767f 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 ea5d4182865d3..76fa9672ef3fd 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 03df0206bbedb..b38ac6604f9e1 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 d1e2e27834304..1a018f72151ba 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 5713d803e8cd7..5db4e5d71cd04 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 1ca3bee11f359..4be29305c1e5d 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 f187f8b266850..465b83024594e 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 90164aab286b6..06a73f41c6c53 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 4340e7a7217da..3aae4dce9b47c 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 03769ce8a84a8..5481f6f12df05 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 089b4f8903e57..92daf02438687 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 a614ae43fc6ff..94eb38476cd38 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 009251df4d4b2..0a75d154e1e21 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 ce56f1ac1c814..81570ee664e01 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 c962f7964f4ba..30060a136cbca 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 cbf33cd8d0279..744cc046d078b 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 684df2e561e5b..50e6a175f3947 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 50ec5e1297a15..b84876ebb3d96 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 0a569c7102481..fcc0ece64dc7e 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 94c4ca4847663..47f50404bb9ac 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 26042e2ee12bf..19a9a199c708f 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 5084c268a1d78..1ea7a489fabc9 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 8ee9f729d04db..86607735519f6 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 5b70c6fcbdc44..bcf3bb33eb98a 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 1522044befa87..a3dfcc5dc206c 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 a11f022e63e16..b65ebf70c7f91 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 f2826d28e39bc..9c68e3fe019d9 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 e3c2ce9629dde..7dc5b8764f9b9 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 a25bf520ea608..232d164cdc6f7 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 cf4144d6d26d3..5aed52400d95c 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 84e31abfc0213..9406eb0f31c54 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 30f0ffd6eb30e..bfa4ebded01bd 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 198fb29baf29b..a03f4cfe07549 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 c13ebcb4a8b92..70370c92afa2d 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 5be735c312daf..97ec559480973 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 38637ad202603..b40aa604a48ad 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 3329d3c1abc0d..806612880c295 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 9a5c07b21e2aa..3da520b7eef1f 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 206c106137322..4e70982d5f52f 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 2fd4123cdfcae..eabd8044103f2 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 951e944c9a7e4..643ac9560ca90 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 a7669c61070d0..0a35a61123262 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 ca5cba3c985ae..865fd1d56d375 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 67dc8b37c67ff..226f43e0b1ab2 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 5eea1ebba439d..172eae45b8734 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 f281ae1ee85b3..fbfeb6a1899fa 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 03bc19e7cc66a..f4d5e8885b761 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 97a5ef939d3fb..ac512a8b42920 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 ece08c721cd73..e4a36e6cc83ae 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 6db31c0e41236..53b091e97906a 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 e3bea2e1b3d67..fa6c3fe2713ab 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 82b790578378d..2e7bb0ccee5c1 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 fef8b2da92371..43cb6db0d922f 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 3fd066ee37f1f..60dbf89e28252 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 0000000000000..7e6b6aa75ca38 --- /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 7e6b6aa75ca38..4cbf374a3be88 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 60dbf89e28252..dcd913bed2e08 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 6d77264d9ae50..d3f4704546bc3 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 d3f4704546bc3..6d77264d9ae50 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 e6fc3e820e480..1461b0348e8aa 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 282ff877e4de2..33ed343af7aee 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 f76ef793ec27f..dad4258dc0b60 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 23958244697de..bd28e68bc81f5 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 e7804ad620471..82f67962b2572 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 87c36a9abf7c7..067024769aea7 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 bea42c580d595..5544688d0baf6 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 9e375ea46439f..c40669e824dba 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 9de56f761767f..e02bd1457d235 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 76fa9672ef3fd..ea5d4182865d3 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 b38ac6604f9e1..03df0206bbedb 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 1a018f72151ba..d1e2e27834304 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 5db4e5d71cd04..5713d803e8cd7 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 4be29305c1e5d..1ca3bee11f359 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 465b83024594e..f187f8b266850 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 06a73f41c6c53..90164aab286b6 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 3aae4dce9b47c..4340e7a7217da 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 5481f6f12df05..03769ce8a84a8 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 92daf02438687..089b4f8903e57 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 94eb38476cd38..a614ae43fc6ff 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 0a75d154e1e21..009251df4d4b2 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 81570ee664e01..ce56f1ac1c814 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 30060a136cbca..c962f7964f4ba 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 744cc046d078b..cbf33cd8d0279 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 50e6a175f3947..684df2e561e5b 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 b84876ebb3d96..50ec5e1297a15 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 fcc0ece64dc7e..0a569c7102481 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 47f50404bb9ac..94c4ca4847663 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 19a9a199c708f..26042e2ee12bf 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 1ea7a489fabc9..5084c268a1d78 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 86607735519f6..8ee9f729d04db 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 bcf3bb33eb98a..5b70c6fcbdc44 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 a3dfcc5dc206c..1522044befa87 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 b65ebf70c7f91..a11f022e63e16 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 9c68e3fe019d9..f2826d28e39bc 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 7dc5b8764f9b9..e3c2ce9629dde 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 232d164cdc6f7..a25bf520ea608 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 5aed52400d95c..cf4144d6d26d3 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 9406eb0f31c54..84e31abfc0213 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 bfa4ebded01bd..30f0ffd6eb30e 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 a03f4cfe07549..198fb29baf29b 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 70370c92afa2d..c13ebcb4a8b92 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 97ec559480973..5be735c312daf 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 b40aa604a48ad..38637ad202603 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 806612880c295..3329d3c1abc0d 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 3da520b7eef1f..9a5c07b21e2aa 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 4e70982d5f52f..206c106137322 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 eabd8044103f2..2fd4123cdfcae 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 643ac9560ca90..951e944c9a7e4 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 0a35a61123262..a7669c61070d0 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 865fd1d56d375..ca5cba3c985ae 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 226f43e0b1ab2..67dc8b37c67ff 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 172eae45b8734..5eea1ebba439d 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 fbfeb6a1899fa..f281ae1ee85b3 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 f4d5e8885b761..03bc19e7cc66a 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 ac512a8b42920..97a5ef939d3fb 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 e4a36e6cc83ae..ece08c721cd73 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 53b091e97906a..6db31c0e41236 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 fa6c3fe2713ab..e3bea2e1b3d67 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 2e7bb0ccee5c1..82b790578378d 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 43cb6db0d922f..fef8b2da92371 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 0000000000000..4dd4142ce1359 --- /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 0000000000000..696b289875914 --- /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 4cbf374a3be88..37d7a9bd10718 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 dcd913bed2e08..bf2dbcba1c719 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 37d7a9bd10718..cffcdb0406a63 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 bf2dbcba1c719..137805118dde5 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 cffcdb0406a63..b5d2e1b559b25 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); } } }