diff --git a/extensions/gii/CodeFile.php b/extensions/gii/CodeFile.php index 7fa57cc004..f64872a0ca 100644 --- a/extensions/gii/CodeFile.php +++ b/extensions/gii/CodeFile.php @@ -61,7 +61,7 @@ class CodeFile extends Object */ public function __construct($path, $content) { - $this->path = strtr($path, ['/' => DIRECTORY_SEPARATOR, '\\' => DIRECTORY_SEPARATOR]); + $this->path = strtr($path, '/\\', DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR); $this->content = $content; $this->id = md5($this->path); if (is_file($path)) { diff --git a/framework/helpers/BaseFileHelper.php b/framework/helpers/BaseFileHelper.php index 54c7d6f8c7..d1909d9a48 100644 --- a/framework/helpers/BaseFileHelper.php +++ b/framework/helpers/BaseFileHelper.php @@ -42,7 +42,7 @@ class BaseFileHelper */ public static function normalizePath($path, $ds = DIRECTORY_SEPARATOR) { - $path = rtrim(strtr($path, ['/' => $ds, '\\' => $ds]), $ds); + $path = rtrim(strtr($path, '/\\', $ds . $ds), $ds); if (strpos($ds . $path, "{$ds}.") === false && strpos($path, "{$ds}{$ds}") === false) { return $path; } diff --git a/framework/helpers/BaseVarDumper.php b/framework/helpers/BaseVarDumper.php index 2ed84fa46b..607a59e758 100644 --- a/framework/helpers/BaseVarDumper.php +++ b/framework/helpers/BaseVarDumper.php @@ -114,7 +114,7 @@ class BaseVarDumper $spaces = str_repeat(' ', $level * 4); self::$_output .= "$className#$id\n" . $spaces . '('; foreach ((array) $var as $key => $value) { - $keyDisplay = strtr(trim($key), ["\0" => ':']); + $keyDisplay = strtr(trim($key), "\0", ':'); self::$_output .= "\n" . $spaces . " [$keyDisplay] => "; self::dumpInternal($value, $level + 1); }