Преглед на файлове

Method exists does not work if you append the () to the method name, thus this never words for objects that actually have the __toString method. Removed the erroneous () so that this works as it appears to have been intended.

Drew Butler преди 14 години
родител
ревизия
dea5b26c3f
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/Symfony/Component/Validator/Constraints/MaxLengthValidator.php

+ 1 - 1
src/Symfony/Component/Validator/Constraints/MaxLengthValidator.php

@@ -23,7 +23,7 @@ class MaxLengthValidator extends ConstraintValidator
             return true;
         }
 
-        if (!is_scalar($value) && !(is_object($value) && method_exists($value, '__toString()'))) {
+        if (!is_scalar($value) && !(is_object($value) && method_exists($value, '__toString'))) {
             throw new UnexpectedTypeException($value, 'string');
         }