Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Validator] Remove Doctrine annotations support #51085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions UPGRADE-7.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ Validator
* Remove static property `$errorNames` from all constraints, use const `ERROR_NAMES` instead
* Remove `VALIDATION_MODE_LOOSE` from `Email` constraint, use `VALIDATION_MODE_HTML5` instead
* Remove constraint `ExpressionLanguageSyntax`, use `ExpressionSyntax` instead
* Remove Doctrine annotations support in favor of native attributes
* Remove the annotation reader parameter from the constructor signature of `AnnotationLoader`
* Remove `ValidatorBuilder::setDoctrineAnnotationReader()`
* Remove `ValidatorBuilder::addDefaultDoctrineAnnotationReader()`

VarDumper
---------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
/**
* Constraint for the Unique Entity validator.
*
* @Annotation
* @Target({"CLASS", "ANNOTATION"})
*
* @author Benjamin Eberlei <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

use Symfony\Component\Validator\Constraint;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
class UserPassword extends Constraint
{
Expand Down
4 changes: 4 additions & 0 deletions src/Symfony/Component/Validator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ CHANGELOG
* Remove static property `$errorNames` from all constraints, use const `ERROR_NAMES` instead
* Remove `VALIDATION_MODE_LOOSE` from `Email` constraint, use `VALIDATION_MODE_HTML5` instead
* Remove constraint `ExpressionLanguageSyntax`, use `ExpressionSyntax` instead
* Remove Doctrine annotations support in favor of native attributes
* Remove the annotation reader parameter from the constructor signature of `AnnotationLoader`
* Remove `ValidatorBuilder::setDoctrineAnnotationReader()`
* Remove `ValidatorBuilder::addDefaultDoctrineAnnotationReader()`

6.4
---
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/All.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
namespace Symfony\Component\Validator\Constraints;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
namespace Symfony\Component\Validator\Constraints;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Przemysław Bogusz <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Bic.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
use Symfony\Component\Validator\Exception\LogicException;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Michael Hirschler <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Blank.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
use Symfony\Component\Validator\Constraint;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
use Symfony\Component\Validator\Constraint;

/**
* @Annotation
* @Target({"CLASS", "PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/CardScheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
/**
* Metadata for the CardSchemeValidator.
*
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Tim Nagel <[email protected]>
* @author Bernhard Schussek <[email protected]>
*/
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Cascade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;

/**
* @Annotation
* @Target({"CLASS"})
*
* @author Jules Pietri <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Choice.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
use Symfony\Component\Validator\Constraint;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Cidr.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
/**
* Validates that a value is a valid CIDR notation.
*
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Sorin Pop <[email protected]>
* @author Calin Bolea <[email protected]>
*/
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Count.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
use Symfony\Component\Validator\Exception\MissingOptionsException;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
use Symfony\Component\Validator\Exception\LogicException;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/CssColor.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
use Symfony\Component\Validator\Exception\InvalidArgumentException;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Mathieu Santostefano <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
use Symfony\Component\Validator\Exception\LogicException;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Miha Vrhovnik <[email protected]>
* @author Bernhard Schussek <[email protected]>
*/
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
use Symfony\Component\Validator\Constraint;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
use Symfony\Component\Validator\Constraint;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
/**
* Disables auto mapping.
*
* Using the annotations on a property has higher precedence than using it on a class,
* Using the attribute on a property has higher precedence than using it on a class,
* which has higher precedence than any configuration that might be defined outside the class.
*
* @Annotation
*
* @author Kévin Dunglas <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/DivisibleBy.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
namespace Symfony\Component\Validator\Constraints;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Colin O'Dell <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
use Symfony\Component\Validator\Exception\LogicException;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
/**
* Enables auto mapping.
*
* Using the annotations on a property has higher precedence than using it on a class,
* Using the attribute on a property has higher precedence than using it on a class,
* which has higher precedence than any configuration that might be defined outside the class.
*
* @Annotation
*
* @author Kévin Dunglas <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/EqualTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
namespace Symfony\Component\Validator\Constraints;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Daniel Holmes <[email protected]>
* @author Bernhard Schussek <[email protected]>
*/
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Expression.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
use Symfony\Component\Validator\Exception\LogicException;

/**
* @Annotation
* @Target({"CLASS", "PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Fabien Potencier <[email protected]>
* @author Bernhard Schussek <[email protected]>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
use Symfony\Component\Validator\Constraint;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Andrey Sevastianov <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @property int $maxSize
*
* @author Bernhard Schussek <[email protected]>
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/GreaterThan.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
namespace Symfony\Component\Validator\Constraints;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Daniel Holmes <[email protected]>
* @author Bernhard Schussek <[email protected]>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
namespace Symfony\Component\Validator\Constraints;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Daniel Holmes <[email protected]>
* @author Bernhard Schussek <[email protected]>
*/
Expand Down
4 changes: 0 additions & 4 deletions src/Symfony/Component/Validator/Constraints/GroupSequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@
*
* $validator->validate($address, null, "Address")
*
* @Annotation
*
* @Target({"CLASS", "ANNOTATION"})
*
* @author Bernhard Schussek <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
/**
* Attribute to define a group sequence provider.
*
* @Annotation
*
* @Target({"CLASS", "ANNOTATION"})
*
* @author Bernhard Schussek <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Hostname.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
use Symfony\Component\Validator\Constraint;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Dmitrii Poddubnyi <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Iban.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
use Symfony\Component\Validator\Constraint;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Manuel Reinhard <[email protected]>
* @author Michael Schummel
* @author Bernhard Schussek <[email protected]>
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/IdenticalTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
namespace Symfony\Component\Validator\Constraints;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Daniel Holmes <[email protected]>
* @author Bernhard Schussek <[email protected]>
*/
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
namespace Symfony\Component\Validator\Constraints;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Benjamin Dulau <[email protected]>
* @author Bernhard Schussek <[email protected]>
*/
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/Ip.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
/**
* Validates that a value is a valid IP address.
*
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <[email protected]>
* @author Joseph Bielawski <[email protected]>
*/
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Validator/Constraints/IsFalse.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
use Symfony\Component\Validator\Constraint;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <[email protected]>
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
Expand Down
Loading