浏览代码

[Locale] changed method name

Eriksen Costa 13 年之前
父节点
当前提交
663d218e97

+ 2 - 2
src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php

@@ -155,7 +155,7 @@ class FullTransformer
         }
 
         // behave like the intl extension
-        StubIntl::setErrorCode(StubIntl::U_PARSE_ERROR, 'Date parsing failed');
+        StubIntl::setError(StubIntl::U_PARSE_ERROR, 'Date parsing failed');
 
         return false;
     }
@@ -292,7 +292,7 @@ class FullTransformer
 
         // If month is false, return immediately (intl behavior)
         if (false === $month) {
-            StubIntl::setErrorCode(StubIntl::U_PARSE_ERROR, 'Date parsing failed');
+            StubIntl::setError(StubIntl::U_PARSE_ERROR, 'Date parsing failed');
 
             return false;
         }

+ 2 - 2
src/Symfony/Component/Locale/Stub/StubIntl.php

@@ -102,14 +102,14 @@ abstract class StubIntl
     }
 
     /**
-     * Sets the current error code
+     * Sets the current error
      *
      * @param  integer $code     One of the error constants in this class
      * @param  string  $message  The ICU class error message
      *
      * @throws \InvalidArgumentException If the code is not one of the error constants in this class
      */
-    static public function setErrorCode($code, $message = '')
+    static public function setError($code, $message = '')
     {
         if (!isset(self::$errorCodes[$code])) {
             throw new \InvalidArgumentException(sprintf('No such error code: "%s"', $code));

+ 1 - 1
src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php

@@ -180,7 +180,7 @@ class StubIntlDateFormatter
 
         // behave like the intl extension
         if (!is_int($timestamp) && version_compare(\PHP_VERSION, '5.3.4', '<')) {
-            StubIntl::setErrorCode(StubIntl::U_ILLEGAL_ARGUMENT_ERROR);
+            StubIntl::setError(StubIntl::U_ILLEGAL_ARGUMENT_ERROR, 'datefmt_format: takes either an array  or an integer timestamp value ');
 
             return false;
         }

+ 1 - 1
src/Symfony/Component/Locale/Stub/StubNumberFormatter.php

@@ -501,7 +501,7 @@ class StubNumberFormatter
 
         // Any string before the numeric value causes error in the parsing
         if (isset($matches[1]) && !empty($matches[1])) {
-            StubIntl::setErrorCode(StubIntl::U_PARSE_ERROR);
+            StubIntl::setError(StubIntl::U_PARSE_ERROR);
             $this->errorCode = StubIntl::getErrorCode();
             $this->errorMessage = StubIntl::getErrorMessage();