Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d9d04f8

Browse filesBrowse files
committed
Document default values
1 parent 05047c5 commit d9d04f8
Copy full SHA for d9d04f8

33 files changed

+66
-69
lines changed

‎src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class AtLeastOneOf extends Composite
4747
* @param mixed|null $payload Domain-specific data attached to a constraint
4848
* @param string|null $message Intro of the failure message that will be followed by the failed constraint(s) message(s)
4949
* @param string|null $messageCollection Failure message for All and Collection inner constraints
50-
* @param bool|null $includeInternalMessages Whether to include inner constraint messages
50+
* @param bool|null $includeInternalMessages Whether to include inner constraint messages (defaults to true)
5151
*/
5252
public function __construct(mixed $constraints = null, array $groups = null, mixed $payload = null, string $message = null, string $messageCollection = null, bool $includeInternalMessages = null)
5353
{

‎src/Symfony/Component/Validator/Constraints/Choice.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Choice.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ public function getDefaultOption(): ?string
6060

6161
/**
6262
* @param string|array $options The options (as associative array) or the array of choices
63-
* @param array|null $choices An array of choices
63+
* @param array|null $choices An array of choices (required unless a callback is specified)
6464
* @param callable|string|null $callback Callback method to use instead of the choice option to get the choices
65-
* @param bool|null $multiple Whether to expect the value to be an array of valid choices
66-
* @param bool|null $strict This option defaults to <pre>true</pre> and should not be used
65+
* @param bool|null $multiple Whether to expect the value to be an array of valid choices (defaults to false)
66+
* @param bool|null $strict This option defaults to true and should not be used
6767
* @param int|null $min Minimum of valid choices if multiple values are expected
6868
* @param int|null $max Maximum of valid choices if multiple values are expected
6969
* @param string|null $message The message if the validation fails
@@ -72,7 +72,7 @@ public function getDefaultOption(): ?string
7272
* @param string|null $maxMessage Message if there are too many choices
7373
* @param string[]|null $groups An array of validation groups
7474
* @param mixed|null $payload Domain-specific data attached to a constraint
75-
* @param bool|null $match Validate values that are not part of given choices
75+
* @param bool|null $match Whether to validate the values are part of the choices or not (defaults to true)
7676
*/
7777
public function __construct(
7878
string|array $options = [],

‎src/Symfony/Component/Validator/Constraints/Cidr.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Cidr.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ class Cidr extends Constraint
6060

6161
/**
6262
* @param array<string,mixed>|null $options The options as an associative array
63-
* @param string|null $version The CIDR version to validate (4, 6 or all)
64-
* @param int|null $netmaskMin The lowest valid for a valid netmask
65-
* @param int|null $netmaskMax The biggest valid for a valid netmask
63+
* @param string|null $version The CIDR version to validate (4, 6 or all, defaults to all)
64+
* @param int|null $netmaskMin The lowest valid for a valid netmask (defaults to 0)
65+
* @param int|null $netmaskMax The biggest valid for a valid netmask (defaults to 32 for IPv4, 128 for IPv6)
6666
* @param string|null $message The message if the validation fails
6767
* @param string[]|null $groups An array of validation groups
6868
* @param mixed|null $payload Domain-specific data attached to a constraint

‎src/Symfony/Component/Validator/Constraints/Collection.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Collection.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class Collection extends Composite
4949
* @param array<string,Constraint>|array<string,mixed>|null $fields An associative array defining keys in the collection and their constraints, or this constraint's options as an associative array
5050
* @param string[]|null $groups An array of validation groups
5151
* @param mixed|null $payload Domain-specific data attached to a constraint
52-
* @param bool|null $allowExtraFields Whether to allow additional keys not declared in the configured fields
53-
* @param bool|null $allowMissingFields Whether to allow the collection to lack some fields declared in the configured fields
52+
* @param bool|null $allowExtraFields Whether to allow additional keys not declared in the configured fields (defaults to false)
53+
* @param bool|null $allowMissingFields Whether to allow the collection to lack some fields declared in the configured fields (defaults to false)
5454
* @param string|null $extraFieldsMessage The message if extra fields are not allowed and the data contains extra fields
5555
* @param string|null $missingFieldsMessage The message if missing fields are not allowed and the data lacks some fields
5656
*/

‎src/Symfony/Component/Validator/Constraints/Country.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Country.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Country extends Constraint
4646
/**
4747
* @param array<string,mixed>|null $options The options as associative array
4848
* @param string|null $message The message if the validation fails
49-
* @param bool|null $alpha3 Whether to check for alpha-3 codes instead of alpha-2
49+
* @param bool|null $alpha3 Whether to check for alpha-3 codes instead of alpha-2 (defaults to false)
5050
* @param string[]|null $groups An array of validation groups
5151
* @param mixed|null $payload Domain-specific data attached to a constraint
5252
*

‎src/Symfony/Component/Validator/Constraints/CssColor.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/CssColor.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CssColor extends Constraint
7171
public $formats;
7272

7373
/**
74-
* @param string[]|string|array<string,mixed> $formats The types of CSS colors allowed (e.g. hexadecimal only, RGB, HSL only, etc.), or this constraint's options as an associative array
74+
* @param string[]|string|array<string,mixed> $formats The types of CSS colors allowed ({@see https://symfony.com/doc/current/reference/constraints/CssColor.html#formats}), or this constraint's options as an associative array
7575
* @param string|null $message The message if the validation fails
7676
* @param string[]|null $groups An array of validation groups
7777
* @param mixed|null $payload Domain-specific data attached to a constraint

‎src/Symfony/Component/Validator/Constraints/DateTime.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/DateTime.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class DateTime extends Constraint
4646
public $message = 'This value is not a valid datetime.';
4747

4848
/**
49-
* @param string|array<string,mixed>|null $format The datetime format to match, or this constraint's options as an associative array
49+
* @param string|array<string,mixed>|null $format The datetime format to match (defaults to 'Y-m-d H:i:s'), or this constraint's options as an associative array
5050
* @param string|null $message The message if the validation fails
5151
* @param string[]|null $groups An array of validation groups
5252
* @param mixed|null $payload Domain-specific data attached to a constraint

‎src/Symfony/Component/Validator/Constraints/Email.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Email.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Email extends Constraint
6262
/**
6363
* @param array<string,mixed>|null $options The options as an associative array
6464
* @param string|null $message The message if the validation fails
65-
* @param self::VALIDATION_MODE_*|null $mode The pattern used to validate the email address (e.g. strict, loose, html5, etc.)
65+
* @param self::VALIDATION_MODE_*|null $mode The pattern used to validate the email address (e.g. strict, loose, html5). Pass null to use the default mode configured for the EmailValidator. (defaults to null)
6666
* @param callable|null $normalizer A callable applied to the value before it is validated
6767
* @param string[]|null $groups An array of validation groups
6868
* @param mixed|null $payload Domain-specific data attached to a constraint

‎src/Symfony/Component/Validator/Constraints/Expression.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Expression.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ class Expression extends Constraint
5050
/**
5151
* @param string|ExpressionObject|array<string,mixed>|null $expression The expression to evaluate, or this constraint's options as an associative array
5252
* @param string|null $message The message if the validation fails
53-
* @param array<string,mixed>|null $values The values of the custom variables used in the expression
53+
* @param array<string,mixed>|null $values The values of the custom variables used in the expression (defaults to an empty array)
5454
* @param string[]|null $groups An array of validation groups
5555
* @param mixed|null $payload Domain-specific data attached to a constraint
5656
* @param array<string,mixed> $options The options as an associative array
57-
* @param bool|null $negate Whether to fail is the expression evaluates to true
57+
* @param bool|null $negate Whether to fail is the expression evaluates to true (defaults to false)
5858
*/
5959
public function __construct(
6060
string|ExpressionObject|array|null $expression,

‎src/Symfony/Component/Validator/Constraints/ExpressionLanguageSyntax.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/ExpressionLanguageSyntax.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ExpressionLanguageSyntax extends Constraint
4848
* @param array<string,mixed>|null $options The options as an associative array
4949
* @param string|null $message The message if the validation fails
5050
* @param string|null $service The service used to validate the constraint instead of the default one
51-
* @param string[]|null $allowedVariables Restrict the available variables in the expression to these values
51+
* @param string[]|null $allowedVariables Restrict the available variables in the expression to these values (defaults to null that allows any variable)
5252
* @param string[]|null $groups An array of validation groups
5353
* @param mixed|null $payload Domain-specific data attached to a constraint
5454
*/

‎src/Symfony/Component/Validator/Constraints/ExpressionSyntax.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/ExpressionSyntax.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ExpressionSyntax extends Constraint
3939
* @param array<string,mixed>|null $options The options as an associative array
4040
* @param string|null $message The message if the validation fails
4141
* @param string|null $service The service used to validate the constraint instead of the default one
42-
* @param string[]|null $allowedVariables Restrict the available variables in the expression to these values
42+
* @param string[]|null $allowedVariables Restrict the available variables in the expression to these values (defaults to null that allows any variable)
4343
* @param string[]|null $groups An array of validation groups
4444
* @param mixed|null $payload Domain-specific data attached to a constraint
4545
*/

‎src/Symfony/Component/Validator/Constraints/File.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/File.php
+4-10Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
* A file can be one of the following:
2121
* - A string (or object with a __toString() method) path to an existing file;
22-
* - A valid {@link \Symfony\Component\HttpFoundation\File\File} object (including objects of {@link \Symfony\Component\HttpFoundation\File\UploadedFile} class).
22+
* - A valid {@see \Symfony\Component\HttpFoundation\File\File File} object (including objects of {@see \Symfony\Component\HttpFoundation\File\UploadedFile UploadedFile} class).
2323
*
2424
* @Annotation
2525
*
@@ -82,8 +82,8 @@ class File extends Constraint
8282
/**
8383
* @param array<string,mixed>|null $options The options as an associative array
8484
* @param int|string|null $maxSize The max size of the underlying file
85-
* @param bool|null $binaryFormat Whether to use the binary format in displayed messages
86-
* @param string[]|string|null $mimeTypes acceptable media type(s)
85+
* @param bool|null $binaryFormat Pass true to use binary-prefixed units (KiB, MiB, etc.) or false to use SI-prefixed units (kB, MB) in displayed messages. Pass null to guess the format from the maxSize option. (defaults to null)
86+
* @param string[]|string|null $mimeTypes Acceptable media type(s). Prefer the extensions option that also enforce the file's extension consistency.
8787
* @param int|null $filenameMaxLength Maximum length of the file name
8888
* @param string|null $notFoundMessage Message if the file can not be found
8989
* @param string|null $notReadableMessage Message if the file can not be red
@@ -101,13 +101,7 @@ class File extends Constraint
101101
* @param string|null $uploadErrorMessage Message if an unknown error occurred on upload
102102
* @param string[]|null $groups An array of validation groups
103103
* @param mixed|null $payload Domain-specific data attached to a constraint
104-
* @param array<string|string[]>|string|null $extensions A list of valid extensions to check. Related media types are also enforced, and can be restricted with:
105-
* <pre>
106-
* [
107-
* 'txt' => 'text/plain', // Only allow 'text/plain' for *.txt
108-
* 'jpg', // Allow all media types related to *.jpg
109-
* ]
110-
* </pre>
104+
* @param array<string|string[]>|string|null $extensions A list of valid extensions to check. Related media types are also enforced ({@see https://symfony.com/doc/current/reference/constraints/File.html#extensions})
111105
* @param string|null $extensionsMessage Message if the file extension does not match any configured extension
112106
*
113107
* @see https://www.iana.org/assignments/media-types/media-types.xhtml Existing media types

‎src/Symfony/Component/Validator/Constraints/Hostname.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Hostname.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Hostname extends Constraint
4242
/**
4343
* @param array<string,mixed>|null $options The options as an associative array
4444
* @param string|null $message The message if the validation fails
45-
* @param bool|null $requireTld Whether to require the hostname to include its top-level domain
45+
* @param bool|null $requireTld Whether to require the hostname to include its top-level domain (defaults to true)
4646
* @param string[]|null $groups An array of validation groups
4747
* @param mixed|null $payload Domain-specific data attached to a constraint
4848
*/

‎src/Symfony/Component/Validator/Constraints/Image.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Image.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class Image extends File
9898
/**
9999
* @param array<string,mixed>|null $options The options as an associative array
100100
* @param int|string|null $maxSize The max size of the underlying file
101-
* @param bool|null $binaryFormat Whether to use the binary format in displayed messages
101+
* @param bool|null $binaryFormat Pass true to use binary-prefixed units (KiB, MiB, etc.) or false to use SI-prefixed units (kB, MB) in displayed messages. Pass null to guess the format from the maxSize option. (defaults to null)
102102
* @param string[]|null $mimeTypes Acceptable media types
103103
* @param int|null $filenameMaxLength Maximum length of the file name
104104
* @param string|null $notFoundMessage Message if the file can not be found
@@ -125,10 +125,10 @@ class Image extends File
125125
* @param int|float|null $minRatio Minimum image ration
126126
* @param int|float|null $minPixels Minimum amount of pixels
127127
* @param int|float|null $maxPixels Maximum amount of pixels
128-
* @param bool|null $allowSquare Whether to allow a square image
129-
* @param bool|null $allowLandscape Whether to allow a landscape image
130-
* @param bool|null $allowPortrait Whether to allow a portrait image
131-
* @param bool|null $detectCorrupted Whether to validate the image is not corrupted
128+
* @param bool|null $allowSquare Whether to allow a square image (defaults to true)
129+
* @param bool|null $allowLandscape Whether to allow a landscape image (defaults to true)
130+
* @param bool|null $allowPortrait Whether to allow a portrait image (defaults to true)
131+
* @param bool|null $detectCorrupted Whether to validate the image is not corrupted (defaults to false)
132132
* @param string|null $sizeNotDetectedMessage Message if the system can not determine image size and there is a size constraint to validate
133133
* @param string|null $maxWidthMessage Message if the image width exceeds the configured max width
134134
* @param string|null $minWidthMessage Message if the image width is lower than the configured min width

‎src/Symfony/Component/Validator/Constraints/Ip.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Ip.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class Ip extends Constraint
8989

9090
/**
9191
* @param array<string,mixed>|null $options The options as an associative array
92-
* @param self::V4*|self::V6*|self::ALL*|null $version The IP version to validate (see {@see self::VERSIONS})
92+
* @param self::V4*|self::V6*|self::ALL*|null $version The IP version to validate (defaults to {@see self::V4})
9393
* @param string|null $message The message if the validation fails
9494
* @param callable|null $normalizer A callable applied to the value before it is validated
9595
* @param string[]|null $groups An array of validation groups

‎src/Symfony/Component/Validator/Constraints/Isbn.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/Isbn.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Isbn extends Constraint
5757
public $message;
5858

5959
/**
60-
* @param self::ISBN_*|array<string,mixed>|null $type The type of ISBN to validate (i.e. isbn10, isbn13 or null), or this constraint's options as an associative array
60+
* @param self::ISBN_*|array<string,mixed>|null $type The type of ISBN to validate (i.e. {@see Isbn::ISBN_10}, {@see Isbn::ISBN_13} or null to accept both, defaults to null), or this constraint's options as an associative array.
6161
* @param string|null $message Message if the constraint fails. If defined, this message has priority over the others
6262
* @param string|null $isbn10Message Message if the constraint fails for isbn10
6363
* @param string|null $isbn13Message Message if the constraint fails for isbn13

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.