Skip to content

Commit

Permalink
removed needFix method
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed Oct 16, 2013
1 parent da8f179 commit bf7a084
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions framework/yii/i18n/MessageFormatter.php
Expand Up @@ -34,7 +34,7 @@ public function format($args)
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);
Expand All @@ -57,7 +57,7 @@ public static function formatMessage($locale, $pattern, $args)
return $pattern;
}

if (self::needFix()) {
if (version_compare(PHP_VERSION, '5.5.0', '<')) {
$pattern = self::replaceNamedArguments($pattern, $args);
$args = array_values($args);
}
Expand Down Expand Up @@ -114,16 +114,5 @@ private static function replaceNamedArguments($pattern, $args)
}
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', '<');
}
}

0 comments on commit bf7a084

Please sign in to comment.