spiral / dumper
Colorful variable dumper
v2.7.4
2020-12-23 19:07 UTC
Requires
- php: >=7.2
- codedungeon/php-cli-colors: ^1.11
- psr/log: ^1.0
Requires (Dev)
- phpunit/phpunit: ^8.5|^9.0
README
Dumper provides the ability to display the content of any given variable or object in a human readable form. Component support dumping into various outputs such as STDOUT, STDERR or log. Component support CLI colorization.
Usage
Installation:
$ composer require spiral/dumper
In your code (works in web and cli SAPIs):
use Spiral\Debug; $d = new Debug\Dumper(); $d->dump($variable);
Dump to Log:
use Spiral\Debug; $d = new Debug\Dumper($loggerInterface); $d->dump($variable, Debug\Dumper::LOGGER);
Dump to STDERR:
use Spiral\Debug; $d = new Debug\Dumper($loggerInterface); $d->dump($variable, Debug\Dumper::STDERR);
Force dump to STDERR with color support:
use Spiral\Debug; $d = new Debug\Dumper($loggerInterface); $d->setRenderer(Debug\Dumper::STDERR, new Debug\Renderer\ConsoleRenderer()); $d->dump($variable, Debug\Dumper::STDERR);
Notes
- component does not dump @internal properties
- use
__debugInfo()
to specify custom set of data to display
License
The MIT License (MIT). Please see LICENSE
for more information. Maintained by SpiralScout.