Browse Source

removed needFix method

tags/2.0.0-beta
Alexander Makarov 11 years ago
parent
commit
bf7a084224
  1. 15
      framework/yii/i18n/MessageFormatter.php

15
framework/yii/i18n/MessageFormatter.php

@ -34,7 +34,7 @@ class MessageFormatter extends \MessageFormatter
return $this->getPattern(); return $this->getPattern();
} }
if (self::needFix()) { if (version_compare(PHP_VERSION, '5.5.0', '<')) {
$pattern = self::replaceNamedArguments($this->getPattern(), $args); $pattern = self::replaceNamedArguments($this->getPattern(), $args);
$this->setPattern($pattern); $this->setPattern($pattern);
$args = array_values($args); $args = array_values($args);
@ -57,7 +57,7 @@ class MessageFormatter extends \MessageFormatter
return $pattern; return $pattern;
} }
if (self::needFix()) { if (version_compare(PHP_VERSION, '5.5.0', '<')) {
$pattern = self::replaceNamedArguments($pattern, $args); $pattern = self::replaceNamedArguments($pattern, $args);
$args = array_values($args); $args = array_values($args);
} }
@ -114,16 +114,5 @@ class MessageFormatter extends \MessageFormatter
} }
return $pattern; 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', '<');
}
} }
Loading…
Cancel
Save