diff --git a/src/Tracy/Bar.php b/src/Tracy/Bar.php index 1916f0ef7..589fb3735 100644 --- a/src/Tracy/Bar.php +++ b/src/Tracy/Bar.php @@ -57,10 +57,10 @@ public function getPanel($id) public function render() { $useSession = $this->useSession && session_status() === PHP_SESSION_ACTIVE; - $redirectQueue = & $_SESSION['_tracy']['redirect']; + $redirectQueue = &$_SESSION['_tracy']['redirect']; foreach (['bar', 'redirect', 'bluescreen'] as $key) { - $queue = & $_SESSION['_tracy'][$key]; + $queue = &$_SESSION['_tracy'][$key]; $queue = array_slice((array) $queue, -10, NULL, TRUE); $queue = array_filter($queue, function ($item) { return isset($item['time']) && $item['time'] > time() - 60; @@ -178,7 +178,7 @@ public function dispatchAssets() } if ($this->useSession && preg_match('#^content(-ajax)?.(\w+)$#', $asset, $m)) { - $session = & $_SESSION['_tracy']['bar'][$m[2] . $m[1]]; + $session = &$_SESSION['_tracy']['bar'][$m[2] . $m[1]]; header('Content-Type: text/javascript'); header('Cache-Control: max-age=60'); header_remove('Set-Cookie'); @@ -190,7 +190,7 @@ public function dispatchAssets() echo "Tracy.Debug.$method(", json_encode($session['content']), ', ', json_encode($session['dumps']), ');'; $session = NULL; } - $session = & $_SESSION['_tracy']['bluescreen'][$m[2]]; + $session = &$_SESSION['_tracy']['bluescreen'][$m[2]]; if ($session) { echo "Tracy.BlueScreen.loadAjax(", json_encode($session['content']), ', ', json_encode($session['dumps']), ');'; $session = NULL; diff --git a/src/Tracy/Dumper.php b/src/Tracy/Dumper.php index 4fd04ab69..eed11cb08 100644 --- a/src/Tracy/Dumper.php +++ b/src/Tracy/Dumper.php @@ -95,7 +95,7 @@ public static function toHtml($var, array $options = NULL) self::COLLAPSE_COUNT => 7, self::OBJECT_EXPORTERS => NULL, ]; - $loc = & $options[self::LOCATION]; + $loc = &$options[self::LOCATION]; $loc = $loc === TRUE ? ~0 : (int) $loc; $options[self::OBJECT_EXPORTERS] = (array) $options[self::OBJECT_EXPORTERS] + self::$objectExporters; @@ -147,7 +147,7 @@ public static function toTerminal($var, array $options = NULL) * @param int current recursion level * @return string */ - private static function dumpVar(& $var, array $options, $level = 0) + private static function dumpVar(&$var, array $options, $level = 0) { if (method_exists(__CLASS__, $m = 'dump' . gettype($var))) { return self::$m($var, $options, $level); @@ -163,19 +163,19 @@ private static function dumpNull() } - private static function dumpBoolean(& $var) + private static function dumpBoolean(&$var) { return '' . ($var ? 'TRUE' : 'FALSE') . "\n"; } - private static function dumpInteger(& $var) + private static function dumpInteger(&$var) { return "$var\n"; } - private static function dumpDouble(& $var) + private static function dumpDouble(&$var) { $var = is_finite($var) ? ($tmp = json_encode($var)) . (strpos($tmp, '.') === FALSE ? '.0' : '') @@ -184,7 +184,7 @@ private static function dumpDouble(& $var) } - private static function dumpString(& $var, $options) + private static function dumpString(&$var, $options) { return '"' . Helpers::escapeHtml(self::encodeString($var, $options[self::TRUNCATE])) @@ -192,7 +192,7 @@ private static function dumpString(& $var, $options) } - private static function dumpArray(& $var, $options, $level) + private static function dumpArray(&$var, $options, $level) { static $marker; if ($marker === NULL) { @@ -213,7 +213,7 @@ private static function dumpArray(& $var, $options, $level) $out = '' . $out . count($var) . ")\n'; $var[$marker] = TRUE; - foreach ($var as $k => & $v) { + foreach ($var as $k => &$v) { if ($k !== $marker) { $k = preg_match('#^\w{1,50}\z#', $k) ? $k : '"' . Helpers::escapeHtml(self::encodeString($k, $options[self::TRUNCATE])) . '"'; $out .= ' ' . str_repeat('| ', $level) . '' @@ -230,7 +230,7 @@ private static function dumpArray(& $var, $options, $level) } - private static function dumpObject(& $var, $options, $level) + private static function dumpObject(&$var, $options, $level) { $fields = self::exportObject($var, $options[self::OBJECT_EXPORTERS]); $editor = NULL; @@ -258,7 +258,7 @@ private static function dumpObject(& $var, $options, $level) $out = '' . $out . "\n'; $list[] = $var; - foreach ($fields as $k => & $v) { + foreach ($fields as $k => &$v) { $vis = ''; if (isset($k[0]) && $k[0] === "\x00") { $vis = ' ' . ($k[1] === '*' ? 'protected' : 'private') . ''; @@ -278,7 +278,7 @@ private static function dumpObject(& $var, $options, $level) } - private static function dumpResource(& $var, $options, $level) + private static function dumpResource(&$var, $options, $level) { $type = get_resource_type($var); $out = '' . Helpers::escapeHtml($type) . ' resource ' @@ -298,7 +298,7 @@ private static function dumpResource(& $var, $options, $level) /** * @return mixed */ - private static function toJson(& $var, $options, $level = 0) + private static function toJson(&$var, $options, $level = 0) { if (is_bool($var) || is_null($var) || is_int($var)) { return $var; @@ -321,7 +321,7 @@ private static function toJson(& $var, $options, $level = 0) } $res = []; $var[$marker] = TRUE; - foreach ($var as $k => & $v) { + foreach ($var as $k => &$v) { if ($k !== $marker) { $k = preg_match('#^\w{1,50}\z#', $k) ? $k : '"' . self::encodeString($k, $options[self::TRUNCATE]) . '"'; $res[] = [$k, self::toJson($v, $options, $level + 1)]; diff --git a/src/Tracy/FireLogger.php b/src/Tracy/FireLogger.php index 840a74c6e..8b3c73cd6 100644 --- a/src/Tracy/FireLogger.php +++ b/src/Tracy/FireLogger.php @@ -114,7 +114,7 @@ public function log($message, $priority = self::DEBUG) * @param int current recursion level * @return string */ - private function jsonDump(& $var, $level = 0) + private function jsonDump(&$var, $level = 0) { if (is_bool($var) || is_null($var) || is_int($var) || is_float($var)) { return $var; @@ -133,7 +133,7 @@ private function jsonDump(& $var, $level = 0) } elseif ($level < $this->maxDepth || !$this->maxDepth) { $var[$marker] = TRUE; $res = []; - foreach ($var as $k => & $v) { + foreach ($var as $k => &$v) { if ($k !== $marker) { $res[$this->jsonDump($k)] = $this->jsonDump($v, $level + 1); } @@ -154,7 +154,7 @@ private function jsonDump(& $var, $level = 0) } elseif ($level < $this->maxDepth || !$this->maxDepth) { $list[] = $var; $res = ["\x00" => '(object) ' . Helpers::getClass($var)]; - foreach ($arr as $k => & $v) { + foreach ($arr as $k => &$v) { if (isset($k[0]) && $k[0] === "\x00") { $k = substr($k, strrpos($k, "\x00") + 1); } diff --git a/src/Tracy/Helpers.php b/src/Tracy/Helpers.php index 546e64111..2cd00032b 100644 --- a/src/Tracy/Helpers.php +++ b/src/Tracy/Helpers.php @@ -56,7 +56,7 @@ public static function editorUri($file, $line = NULL) public static function formatHtml($mask) { $args = func_get_args(); - return preg_replace_callback('#%#', function () use (& $args, & $count) { + return preg_replace_callback('#%#', function () use (&$args, &$count) { return Helpers::escapeHtml($args[++$count]); }, $mask); } @@ -68,7 +68,7 @@ public static function escapeHtml($s) } - public static function findTrace(array $trace, $method, & $index = NULL) + public static function findTrace(array $trace, $method, &$index = NULL) { $m = explode('::', $method); foreach ($trace as $i => $item) { diff --git a/tests/Tracy/Debugger.E_COMPILE_ERROR.console.phpt b/tests/Tracy/Debugger.E_COMPILE_ERROR.console.phpt index a62a04dec..726bfb869 100644 --- a/tests/Tracy/Debugger.E_COMPILE_ERROR.console.phpt +++ b/tests/Tracy/Debugger.E_COMPILE_ERROR.console.phpt @@ -22,7 +22,7 @@ Debugger::enable(); $onFatalErrorCalled = FALSE; -register_shutdown_function(function () use (& $onFatalErrorCalled) { +register_shutdown_function(function () use (&$onFatalErrorCalled) { Assert::true($onFatalErrorCalled); Assert::match(extension_loaded('xdebug') ? " Fatal error: Cannot re-assign \$this in %a% @@ -45,7 +45,7 @@ Unable to log error: Directory is not specified. }); -Debugger::$onFatalError[] = function () use (& $onFatalErrorCalled) { +Debugger::$onFatalError[] = function () use (&$onFatalErrorCalled) { $onFatalErrorCalled = TRUE; }; diff --git a/tests/Tracy/Debugger.E_ERROR.console.phpt b/tests/Tracy/Debugger.E_ERROR.console.phpt index efca70197..fb11899c1 100644 --- a/tests/Tracy/Debugger.E_ERROR.console.phpt +++ b/tests/Tracy/Debugger.E_ERROR.console.phpt @@ -22,7 +22,7 @@ Debugger::enable(); $onFatalErrorCalled = FALSE; -register_shutdown_function(function () use (& $onFatalErrorCalled) { +register_shutdown_function(function () use (&$onFatalErrorCalled) { Assert::true($onFatalErrorCalled); Assert::match(PHP_MAJOR_VERSION > 5 ? "Error: Call to undefined function missing_function() in %a% @@ -53,7 +53,7 @@ Unable to log error: Directory is not specified. }); -Debugger::$onFatalError[] = function () use (& $onFatalErrorCalled) { +Debugger::$onFatalError[] = function () use (&$onFatalErrorCalled) { $onFatalErrorCalled = TRUE; }; diff --git a/tests/Tracy/Debugger.E_ERROR.html.phpt b/tests/Tracy/Debugger.E_ERROR.html.phpt index 8cbea24ef..c7702eb5c 100644 --- a/tests/Tracy/Debugger.E_ERROR.html.phpt +++ b/tests/Tracy/Debugger.E_ERROR.html.phpt @@ -27,7 +27,7 @@ Debugger::enable(); $onFatalErrorCalled = FALSE; -register_shutdown_function(function () use (& $onFatalErrorCalled) { +register_shutdown_function(function () use (&$onFatalErrorCalled) { Assert::true($onFatalErrorCalled); $output = ob_get_clean(); Assert::same(1, substr_count($output, '