Skip to content
Permalink
Browse files

[Locale] changed method name

  • Loading branch information...
eriksencosta committed Apr 14, 2012
1 parent bb61e09 commit 663d218e97a5b1d415804c48ea54ddcea948790d
@@ -155,7 +155,7 @@ public function parse(\DateTime $dateTime, $value)
}
// 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 @@ protected function calculateUnixTimestamp(\DateTime $dateTime, array $options)
// 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;
}
@@ -102,14 +102,14 @@ static public function getErrorMessage()
}
/**
* 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));
@@ -180,7 +180,7 @@ public function format($timestamp)
// 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;
}
@@ -501,7 +501,7 @@ public function parse($value, $type = self::TYPE_DOUBLE, &$position = null)
// 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();

0 comments on commit 663d218

Please sign in to comment.
You can’t perform that action at this time.