Skip to content

Commit

Permalink
coding style: removed space after reference &
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jan 13, 2017
1 parent 2e098b5 commit eccbe1b
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 30 deletions.
8 changes: 4 additions & 4 deletions src/Tracy/Bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand All @@ -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;
Expand Down
26 changes: 13 additions & 13 deletions src/Tracy/Dumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -163,19 +163,19 @@ private static function dumpNull()
}


private static function dumpBoolean(& $var)
private static function dumpBoolean(&$var)
{
return '<span class="tracy-dump-bool">' . ($var ? 'TRUE' : 'FALSE') . "</span>\n";
}


private static function dumpInteger(& $var)
private static function dumpInteger(&$var)
{
return "<span class=\"tracy-dump-number\">$var</span>\n";
}


private static function dumpDouble(& $var)
private static function dumpDouble(&$var)
{
$var = is_finite($var)
? ($tmp = json_encode($var)) . (strpos($tmp, '.') === FALSE ? '.0' : '')
Expand All @@ -184,15 +184,15 @@ private static function dumpDouble(& $var)
}


private static function dumpString(& $var, $options)
private static function dumpString(&$var, $options)
{
return '<span class="tracy-dump-string">"'
. Helpers::escapeHtml(self::encodeString($var, $options[self::TRUNCATE]))
. '"</span>' . (strlen($var) > 1 ? ' (' . strlen($var) . ')' : '') . "\n";
}


private static function dumpArray(& $var, $options, $level)
private static function dumpArray(&$var, $options, $level)
{
static $marker;
if ($marker === NULL) {
Expand All @@ -213,7 +213,7 @@ private static function dumpArray(& $var, $options, $level)
$out = '<span class="tracy-toggle' . ($collapsed ? ' tracy-collapsed' : '') . '">'
. $out . count($var) . ")</span>\n<div" . ($collapsed ? ' class="tracy-collapsed"' : '') . '>';
$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 .= '<span class="tracy-dump-indent"> ' . str_repeat('| ', $level) . '</span>'
Expand All @@ -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;
Expand Down Expand Up @@ -258,7 +258,7 @@ private static function dumpObject(& $var, $options, $level)
$out = '<span class="tracy-toggle' . ($collapsed ? ' tracy-collapsed' : '') . '">'
. $out . "</span>\n<div" . ($collapsed ? ' class="tracy-collapsed"' : '') . '>';
$list[] = $var;
foreach ($fields as $k => & $v) {
foreach ($fields as $k => &$v) {
$vis = '';
if (isset($k[0]) && $k[0] === "\x00") {
$vis = ' <span class="tracy-dump-visibility">' . ($k[1] === '*' ? 'protected' : 'private') . '</span>';
Expand All @@ -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 = '<span class="tracy-dump-resource">' . Helpers::escapeHtml($type) . ' resource</span> '
Expand All @@ -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;
Expand All @@ -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)];
Expand Down
6 changes: 3 additions & 3 deletions src/Tracy/FireLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Tracy/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions tests/Tracy/Debugger.E_COMPILE_ERROR.console.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand All @@ -45,7 +45,7 @@ Unable to log error: Directory is not specified.
});


Debugger::$onFatalError[] = function () use (& $onFatalErrorCalled) {
Debugger::$onFatalError[] = function () use (&$onFatalErrorCalled) {
$onFatalErrorCalled = TRUE;
};

Expand Down
4 changes: 2 additions & 2 deletions tests/Tracy/Debugger.E_ERROR.console.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down Expand Up @@ -53,7 +53,7 @@ Unable to log error: Directory is not specified.
});


Debugger::$onFatalError[] = function () use (& $onFatalErrorCalled) {
Debugger::$onFatalError[] = function () use (&$onFatalErrorCalled) {
$onFatalErrorCalled = TRUE;
};

Expand Down
4 changes: 2 additions & 2 deletions tests/Tracy/Debugger.E_ERROR.html.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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, '<!-- Tracy Debug Bar'));
Expand All @@ -36,7 +36,7 @@ register_shutdown_function(function () use (& $onFatalErrorCalled) {
});


Debugger::$onFatalError[] = function () use (& $onFatalErrorCalled) {
Debugger::$onFatalError[] = function () use (&$onFatalErrorCalled) {
$onFatalErrorCalled = TRUE;
};

Expand Down
4 changes: 2 additions & 2 deletions tests/Tracy/Dumper.toText().recursion.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require __DIR__ . '/../bootstrap.php';


$arr = [1, 2, 3];
$arr[] = & $arr;
$arr[] = &$arr;
Assert::match('array (4)
0 => 1
1 => 2
Expand All @@ -26,7 +26,7 @@ Assert::match('array (4)


$arr = (object) ['x' => 1, 'y' => 2];
$arr->z = & $arr;
$arr->z = &$arr;
Assert::match('stdClass #%a%
x => 1
y => 2
Expand Down

0 comments on commit eccbe1b

Please sign in to comment.