removed needFix method

This commit is contained in:
Alexander Makarov
2013-10-17 01:04:42 +04:00
parent da8f17955f
commit bf7a084224

View File

@@ -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', '<');
}
}