8000 minor #18113 [Validator] Updating inaccurate docblock comment (natech… · symfony/symfony@a908185 · GitHub
[go: up one dir, main page]

Skip to content

Commit a908185

Browse files
minor #18113 [Validator] Updating inaccurate docblock comment (natechicago)
This PR was merged into the 2.3 branch. Discussion ---------- [Validator] Updating inaccurate docblock comment | Q | A | ------------- | --- | Branch | 2.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a The formatValue() docblock refers to a $prettyDateTime argument, which does not exist. Instead, it should refer to the $format argument. I'm also adding parentheses around the `$format & self::OBJECT_TO_STRING` expression on line 102 so it is formatted similarly to the `($format & self::PRETTY_DATE)` expression a few lines above it. Commits ------- a784743 [Validator] Updating inaccurate docblock comment
2 parents 0f35599 + a784743 commit a908185

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/Validator/ConstraintValidator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ protected function formatTypeOf($value)
6969
* This method returns the equivalent PHP tokens for most scalar types
7070
* (i.e. "false" for false, "1" for 1 etc.). Strings are always wrapped
7171
* in double quotes ("). Objects, arrays and resources are formatted as
72-
* "object", "array" and "resource". If the parameter $prettyDateTime
73-
* is set to true, {@link \DateTime} objects will be formatted as
74-
* RFC-3339 dates ("Y-m-d H:i:s").
72+
* "object", "array" and "resource". If the $format bitmask contains
73+
* the PRETTY_DATE bit, then {@link \DateTime} objects will be formatted
74+
* as RFC-3339 dates ("Y-m-d H:i:s").
7575
*
7676
* Be careful when passing message parameters to a constraint violation
7777
* that (may) contain objects, arrays or resources. These parameters
@@ -99,7 +99,7 @@ protected function formatValue($value, $format = 0)
9999
}
100100

101101
if (is_object($value)) {
102-
if ($format & self::OBJECT_TO_STRING && method_exists($value, '__toString')) {
102+
if (($format & self::OBJECT_TO_STRING) && method_exists($value, '__toString')) {
103103
return $value->__toString();
104104
}
105105

0 commit comments

Comments
 (0)
0