From a78474360927c58bebb433c4c0a6dfac675995e4 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 11 Mar 2016 18:42:00 -0600 Subject: [PATCH] [Validator] Updating inaccurate docblock comment The formatValue() docblock refers to a $prettyDateTime argument, which does not exist. Instead, it should refer to the $format argument. --- src/Symfony/Component/Validator/ConstraintValidator.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Validator/ConstraintValidator.php b/src/Symfony/Component/Validator/ConstraintValidator.php index f07a2d9fa3..3e4c5420da 100644 --- a/src/Symfony/Component/Validator/ConstraintValidator.php +++ b/src/Symfony/Component/Validator/ConstraintValidator.php @@ -69,9 +69,9 @@ abstract class ConstraintValidator implements ConstraintValidatorInterface * This method returns the equivalent PHP tokens for most scalar types * (i.e. "false" for false, "1" for 1 etc.). Strings are always wrapped * in double quotes ("). Objects, arrays and resources are formatted as - * "object", "array" and "resource". If the parameter $prettyDateTime - * is set to true, {@link \DateTime} objects will be formatted as - * RFC-3339 dates ("Y-m-d H:i:s"). + * "object", "array" and "resource". If the $format bitmask contains + * the PRETTY_DATE bit, then {@link \DateTime} objects will be formatted + * as RFC-3339 dates ("Y-m-d H:i:s"). * * Be careful when passing message parameters to a constraint violation * that (may) contain objects, arrays or resources. These parameters @@ -99,7 +99,7 @@ abstract class ConstraintValidator implements ConstraintValidatorInterface } if (is_object($value)) { - if ($format & self::OBJECT_TO_STRING && method_exists($value, '__toString')) { + if (($format & self::OBJECT_TO_STRING) && method_exists($value, '__toString')) { return $value->__toString(); }