[Locale] changed method name
This commit is contained in:
parent
bb61e09340
commit
663d218e97
@ -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;
|
||||
}
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user