From 663d218e97a5b1d415804c48ea54ddcea948790d Mon Sep 17 00:00:00 2001 From: Eriksen Costa Date: Sat, 14 Apr 2012 17:15:57 -0300 Subject: [PATCH] [Locale] changed method name --- .../Component/Locale/Stub/DateFormat/FullTransformer.php | 4 ++-- src/Symfony/Component/Locale/Stub/StubIntl.php | 4 ++-- src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php | 2 +- src/Symfony/Component/Locale/Stub/StubNumberFormatter.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php index c13b1a330c..e06e0431ec 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php +++ b/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; } diff --git a/src/Symfony/Component/Locale/Stub/StubIntl.php b/src/Symfony/Component/Locale/Stub/StubIntl.php index 509e1ee494..a036e15056 100644 --- a/src/Symfony/Component/Locale/Stub/StubIntl.php +++ b/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)); diff --git a/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php b/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php index 10392c052d..5b68291260 100644 --- a/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php +++ b/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; } diff --git a/src/Symfony/Component/Locale/Stub/StubNumberFormatter.php b/src/Symfony/Component/Locale/Stub/StubNumberFormatter.php index ad72c2183d..73719d6293 100644 --- a/src/Symfony/Component/Locale/Stub/StubNumberFormatter.php +++ b/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();