Permalink
Browse files

default value for array parameters changed to []

  • Loading branch information...
dg committed Feb 12, 2019
1 parent 69136d2 commit 21a12f0ecb340bfe70c775d9e05a6e936dc826a1
Showing with 11 additions and 11 deletions.
  1. +1 βˆ’1 src/Tracy/Bar.php
  2. +2 βˆ’2 src/Tracy/BlueScreen.php
  3. +2 βˆ’2 src/Tracy/Debugger.php
  4. +5 βˆ’5 src/Tracy/Dumper.php
  5. +1 βˆ’1 src/Tracy/assets/BlueScreen/content.phtml
@@ -133,7 +133,7 @@ private static function renderHtmlRows(array $rows): string
}
private function renderPanels(string $suffix = null): array
private function renderPanels(string $suffix = ''): array
{
set_error_handler(function (int $severity, string $message, string $file, int $line) {
if (error_reporting() & $severity) {
@@ -237,7 +237,7 @@ private function renderActions(\Throwable $ex): array
/**
* Returns syntax highlighted source code.
*/
public static function highlightFile(string $file, int $line, int $lines = 15, array $vars = null): ?string
public static function highlightFile(string $file, int $line, int $lines = 15, array $vars = []): ?string
{
$source = @file_get_contents($file); // @ file may not exist
if ($source) {
@@ -253,7 +253,7 @@ public static function highlightFile(string $file, int $line, int $lines = 15, a
/**
* Returns syntax highlighted source code.
*/
public static function highlightPhp(string $source, int $line, int $lines = 15, array $vars = null): string
public static function highlightPhp(string $source, int $line, int $lines = 15, array $vars = []): string
{
if (function_exists('ini_set')) {
ini_set('highlight.comment', '#998; font-style: italic');
@@ -534,14 +534,14 @@ public static function timer(string $name = null): float
* @param mixed $var
* @return mixed variable itself
*/
public static function barDump($var, string $title = null, array $options = null)
public static function barDump($var, string $title = null, array $options = [])
{
if (!self::$productionMode) {
static $panel;
if (!$panel) {
self::getBar()->addPanel($panel = new DefaultBarPanel('dumps'), 'Tracy:dumps');
}
$panel->data[] = ['title' => $title, 'dump' => Dumper::toHtml($var, (array) $options + [
$panel->data[] = ['title' => $title, 'dump' => Dumper::toHtml($var, $options + [
Dumper::DEPTH => self::$maxDepth,
Dumper::TRUNCATE => self::$maxLength,
Dumper::LOCATION => self::$showLocation ?: Dumper::LOCATION_CLASS | Dumper::LOCATION_SOURCE,
@@ -74,7 +74,7 @@ class Dumper
* Dumps variable to the output.
* @return mixed variable
*/
public static function dump($var, array $options = null)
public static function dump($var, array $options = [])
{
if (PHP_SAPI !== 'cli' && !preg_match('#^Content-Type: (?!text/html)#im', implode("\n", headers_list()))) {
echo self::toHtml($var, $options);
@@ -90,9 +90,9 @@ public static function dump($var, array $options = null)
/**
* Dumps variable to HTML.
*/
public static function toHtml($var, array $options = null): string
public static function toHtml($var, array $options = []): string
{
$options = (array) $options + [
$options += [
self::DEPTH => 4,
self::TRUNCATE => 150,
self::COLLAPSE => 14,
@@ -128,7 +128,7 @@ public static function toHtml($var, array $options = null): string
/**
* Dumps variable to plain text.
*/
public static function toText($var, array $options = null): string
public static function toText($var, array $options = []): string
{
return htmlspecialchars_decode(strip_tags(self::toHtml($var, $options)), ENT_QUOTES);
}
@@ -137,7 +137,7 @@ public static function toText($var, array $options = null): string
/**
* Dumps variable to x-terminal.
*/
public static function toTerminal($var, array $options = null): string
public static function toTerminal($var, array $options = []): string
{
return htmlspecialchars_decode(strip_tags(preg_replace_callback('#<span class="tracy-dump-(\w+)">|</span>#', function ($m): string {
return "\033[" . (isset($m[1], self::$terminalColors[$m[1]]) ? self::$terminalColors[$m[1]] : '0') . 'm';
@@ -83,7 +83,7 @@ $code = $exception->getCode() ? ' #' . $exception->getCode() : '';

<div class="<?= $collapsed ? 'tracy-collapsed ' : '' ?>inner">
<p><b>File:</b> <?= Helpers::editorLink($ex->getFile(), $ex->getLine()) ?></p>
<?php if (is_file($ex->getFile())): ?><?= self::highlightFile($ex->getFile(), $ex->getLine(), 15, $ex instanceof \ErrorException && isset($ex->context) ? $ex->context : null) ?><?php endif ?>
<?php if (is_file($ex->getFile())): ?><?= self::highlightFile($ex->getFile(), $ex->getLine(), 15, $ex instanceof \ErrorException && isset($ex->context) ? $ex->context : []) ?><?php endif ?>
</div></div>


0 comments on commit 21a12f0

Please sign in to comment.