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

Skip to content

Add phpdoc for constraint #42136

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

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 5 additions & 0 deletions src/Symfony/Component/Validator/Constraints/All.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace Symfony\Component\Validator\Constraints;

use Symfony\Component\Validator\Constraint;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
Expand All @@ -19,6 +21,9 @@
*/
class All extends Composite
{
/**
* @var Constraint[]
*/
public $constraints = [];

public function getDefaultOption()
Expand Down
17 changes: 17 additions & 0 deletions src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace Symfony\Component\Validator\Constraints;

use Symfony\Component\Validator\Constraint;

/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
Expand All @@ -25,9 +27,24 @@ class AtLeastOneOf extends Composite
self::AT_LEAST_ONE_OF_ERROR => 'AT_LEAST_ONE_OF_ERROR',
];

/**
* @var Constraint[]
*/
public $constraints = [];

/**
* @var string
*/
public $message = 'This value should satisfy at least one of the following constraints:';

/**
* @var string
*/
public $messageCollection = 'Each element of this collection should satisfy its own set of constraints.';

/**
* @var bool
*/
public $includeInternalMessages = true;

public function getDefaultOption()
Expand Down
15 changes: 15 additions & 0 deletions src/Symfony/Component/Validator/Constraints/Bic.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,24 @@ class Bic extends Constraint
self::INVALID_CASE_ERROR => 'INVALID_CASE_ERROR',
];

/**
* @var string
*/
public $message = 'This is not a valid Business Identifier Code (BIC).';

/**
* @var string
*/
public $ibanMessage = 'This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.';

/**
* @var string|null
*/
public $iban;

/**
* @var string|PropertyPathInterface|null
*/
public $ibanPropertyPath;

/**
Expand Down
3 changes: 3 additions & 0 deletions src/Symfony/Component/Validator/Constraints/Blank.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class Blank extends Constraint
self::NOT_BLANK_ERROR => 'NOT_BLANK_ERROR',
];

/**
* @var string
*/
public $message = 'This value should be blank.';

public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null)
Expand Down
7 changes: 7 additions & 0 deletions src/Symfony/Component/Validator/Constraints/CardScheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ class CardScheme extends Constraint
self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR',
];

/**
* @var string
*/
public $message = 'Unsupported card type or invalid card number.';

/**
* @var string|string[]
*/
public $schemes;

/**
Expand Down
39 changes: 39 additions & 0 deletions src/Symfony/Component/Validator/Constraints/Choice.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,54 @@ class Choice extends Constraint
self::TOO_MANY_ERROR => 'TOO_MANY_ERROR',
];

/**
* @var array|null
*/
public $choices;

/**
* @var string|callable|null
*/
public $callback;

/**
* @var bool
*/
public $multiple = false;

/**
* @var bool
*/
public $strict = true;

/**
* @var int|null
*/
public $min;

/**
* @var int|null
*/
public $max;

/**
* @var string
*/
public $message = 'The value you selected is not a valid choice.';

/**
* @var string
*/
public $multipleMessage = 'One or more of the given values is invalid.';

/**
* @var string
*/
public $minMessage = 'You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.';

/**
* @var string
*/
public $maxMessage = 'You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.';

/**
Expand Down
19 changes: 19 additions & 0 deletions src/Symfony/Component/Validator/Constraints/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,29 @@ class Collection extends Composite
self::NO_SUCH_FIELD_ERROR => 'NO_SUCH_FIELD_ERROR',
];

/**
* @var array
*/
public $fields = [];

/**
* @var bool
*/
public $allowExtraFields = false;

/**
* @var bool
*/
public $allowMissingFields = false;

/**
* @var string
*/
public $extraFieldsMessage = 'This field was not expected.';

/**
* @var string
*/
public $missingFieldsMessage = 'This field is missing.';

/**
Expand Down
27 changes: 27 additions & 0 deletions src/Symfony/Component/Validator/Constraints/Count.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,39 @@ class Count extends Constraint
self::NOT_DIVISIBLE_BY_ERROR => 'NOT_DIVISIBLE_BY_ERROR',
];

/**
* @var string
*/
public $minMessage = 'This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.';

/**
* @var string
*/
public $maxMessage = 'This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.';

/**
* @var string
*/
public $exactMessage = 'This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.';

/**
* @var string
*/
public $divisibleByMessage = 'The number of elements in this collection should be a multiple of {{ compared_value }}.';

/**
* @var int|null
*/
public $min;

/**
* @var int|null
*/
public $max;

/**
* @var int|null
*/
public $divisibleBy;

/**
Expand Down
7 changes: 7 additions & 0 deletions src/Symfony/Component/Validator/Constraints/Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ class Country extends Constraint
self::NO_SUCH_COUNTRY_ERROR => 'NO_SUCH_COUNTRY_ERROR',
];

/**
* @var string
*/
public $message = 'This value is not a valid country.';

/**
* @var bool
*/
public $alpha3 = false;

public function __construct(
Expand Down
3 changes: 3 additions & 0 deletions src/Symfony/Component/Validator/Constraints/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class Currency extends Constraint
self::NO_SUCH_CURRENCY_ERROR => 'NO_SUCH_CURRENCY_ERROR',
];

/**
* @var string
*/
public $message = 'This value is not a valid currency.';

public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null)
Expand Down
3 changes: 3 additions & 0 deletions src/Symfony/Component/Validator/Constraints/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class Date extends Constraint
self::INVALID_DATE_ERROR => 'INVALID_DATE_ERROR',
];

/**
* @var string
*/
public $message = 'This value is not a valid date.';

public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null)
Expand Down
7 changes: 7 additions & 0 deletions src/Symfony/Component/Validator/Constraints/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ class DateTime extends Constraint
self::INVALID_TIME_ERROR => 'INVALID_TIME_ERROR',
];

/**
* @var string
*/
public $format = 'Y-m-d H:i:s';

/**
* @var string
*/
public $message = 'This value is not a valid datetime.';

/**
Expand Down
3 changes: 3 additions & 0 deletions src/Symfony/Component/Validator/Constraints/DivisibleBy.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@ class DivisibleBy extends AbstractComparison
self::NOT_DIVISIBLE_BY => 'NOT_DIVISIBLE_BY',
];

/**
* @var string
*/
public $message = 'This value should be a multiple of {{ compared_value }}.';
}
11 changes: 11 additions & 0 deletions src/Symfony/Component/Validator/Constraints/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,19 @@ class Email extends Constraint
self::VALIDATION_MODE_LOOSE,
];

/**
* @var string
*/
public $message = 'This value is not a valid email address.';

/**
* @var string
*/
public $mode;

/**
* @var callable
*/
public $normalizer;

public function __construct(
Expand Down
3 changes: 3 additions & 0 deletions src/Symfony/Component/Validator/Constraints/EqualTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ class EqualTo extends AbstractComparison
self::NOT_EQUAL_ERROR => 'NOT_EQUAL_ERROR',
];

/**
* @var string
*/
public $message = 'This value should be equal to {{ compared_value }}.';
}
11 changes: 11 additions & 0 deletions src/Symfony/Component/Validator/Constraints/Expression.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,19 @@ class Expression extends Constraint
self::EXPRESSION_FAILED_ERROR => 'EXPRESSION_FAILED_ERROR',
];

/**
* @var string
*/
public $message = 'This value is not valid.';

/**
* @var string|ExpressionObject
*/
public $expression;

/**
* @var array
*/
public $values = [];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,19 @@ class ExpressionLanguageSyntax extends Constraint
self::EXPRESSION_LANGUAGE_SYNTAX_ERROR => 'EXPRESSION_LANGUAGE_SYNTAX_ERROR',
];

/**
* @var string
*/
public $message = 'This value should be a valid expression.';

/**
* @var string
*/
public $service;

/**
* @var array
*/
public $allowedVariables;

public function __construct(array $options = null, string $message = null, string $service = null, array $allowedVariables = null, array $groups = null, $payload = null)
Expand Down
Loading