Skip to content

Commit

Permalink
Debugger, TracyExtension: added $maxItems and option 'maxItems' [Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
dg authored and forrest79 committed Apr 1, 2022
1 parent b000e98 commit 59f64a3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Bridges/Nette/TracyExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public function getConfigSchema(): Nette\Schema\Schema
'showBar' => Expect::bool()->dynamic(),
'maxLength' => Expect::int()->dynamic(),
'maxDepth' => Expect::int()->dynamic(),
'maxItems' => Expect::int()->dynamic(),
'keysToHide' => Expect::array(null)->dynamic(),
'dumpTheme' => Expect::string()->dynamic(),
'showLocation' => Expect::bool()->dynamic(),
Expand Down
4 changes: 4 additions & 0 deletions src/Tracy/BlueScreen/BlueScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class BlueScreen
/** @var int */
public $maxLength = 150;

/** @var int */
public $maxItems = 100;

/** @var callable|null a callable returning true for sensitive data; fn(string $key, mixed $val): bool */
public $scrubber;

Expand Down Expand Up @@ -445,6 +448,7 @@ public function getDumper(): \Closure
return Dumper::toHtml($v, [
Dumper::DEPTH => $this->maxDepth,
Dumper::TRUNCATE => $this->maxLength,
Dumper::ITEMS => $this->maxItems,
Dumper::SNAPSHOT => &$this->snapshot,
Dumper::LOCATION => Dumper::LOCATION_CLASS,
Dumper::SCRUBBER => $this->scrubber,
Expand Down
5 changes: 5 additions & 0 deletions src/Tracy/Debugger/Debugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ class Debugger
/** @var int how long strings display by dump() */
public static $maxLength = 150;

/** @var int how many items in array/object display by dump() */
public static $maxItems = 100;

/** @var bool display location by dump()? */
public static $showLocation;

Expand Down Expand Up @@ -525,6 +528,7 @@ public static function dump($var, bool $return = false)
$options = [
Dumper::DEPTH => self::$maxDepth,
Dumper::TRUNCATE => self::$maxLength,
Dumper::ITEMS => self::$maxItems,
];
return Helpers::isCli()
? Dumper::toText($var)
Expand All @@ -536,6 +540,7 @@ public static function dump($var, bool $return = false)
Dumper::dump($var, [
Dumper::DEPTH => self::$maxDepth,
Dumper::TRUNCATE => self::$maxLength,
Dumper::ITEMS => self::$maxItems,
Dumper::LOCATION => self::$showLocation,
Dumper::THEME => self::$dumpTheme,
Dumper::KEYS_TO_HIDE => self::$keysToHide,
Expand Down

0 comments on commit 59f64a3

Please sign in to comment.