mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-17 06:48:59 +08:00
removed needFix method
This commit is contained in:
@@ -34,7 +34,7 @@ class MessageFormatter extends \MessageFormatter
|
||||
return $this->getPattern();
|
||||
}
|
||||
|
||||
if (self::needFix()) {
|
||||
if (version_compare(PHP_VERSION, '5.5.0', '<')) {
|
||||
$pattern = self::replaceNamedArguments($this->getPattern(), $args);
|
||||
$this->setPattern($pattern);
|
||||
$args = array_values($args);
|
||||
@@ -57,7 +57,7 @@ class MessageFormatter extends \MessageFormatter
|
||||
return $pattern;
|
||||
}
|
||||
|
||||
if (self::needFix()) {
|
||||
if (version_compare(PHP_VERSION, '5.5.0', '<')) {
|
||||
$pattern = self::replaceNamedArguments($pattern, $args);
|
||||
$args = array_values($args);
|
||||
}
|
||||
@@ -114,16 +114,5 @@ class MessageFormatter extends \MessageFormatter
|
||||
}
|
||||
return $pattern;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if fix should be applied
|
||||
*
|
||||
* @see http://php.net/manual/en/migration55.changed-functions.php
|
||||
* @return boolean if fix should be applied
|
||||
*/
|
||||
private static function needFix()
|
||||
{
|
||||
return version_compare(PHP_VERSION, '5.5.0', '<');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user