spiral/dumper

Dumper for PHP variables based on Symfony VarDumper for Spiral Framework and RoadRunner

Fund package maintenance!
roadrunner-server

Installs: 214 384

Dependents: 7

Suggesters: 1

Security: 0

Stars: 8

Watchers: 7

Forks: 1

3.2.2 2024-01-02 08:55 UTC

README

Latest Stable Version Codecov

With spiral/dumper, developers can easily inspect and analyze variable values during the development process, making it an indispensable tool for debugging and troubleshooting in web and CLI applications.

The component provides a wrapper over the symfony/var-dumper library. This component sends dumps directly to the browser within HTTP workers or to the STDERR output in other environments.

Documentation

Usage

Installation:

composer require spiral/dumper

In your code:

dump($variable);

In an application using RoadRunner, you cannot use the dd() function. But the package provides an alternative \rr\dd() function. To use it, you need to add Spiral\Debug\Middleware\DumperMiddleware in the application, after ErrorHandlerMiddleware:

use Spiral\Bootloader\Http\RoutesBootloader as BaseRoutesBootloader;
use Spiral\Debug\Middleware\DumperMiddleware;
use Spiral\Http\Middleware\ErrorHandlerMiddleware;

final class RoutesBootloader extends BaseRoutesBootloader
{
    protected function globalMiddleware(): array
    {
        return [
            ErrorHandlerMiddleware::class,
            DumperMiddleware::class,
            // ...
        ];
    }

    // ...
}

License

The MIT License (MIT). Please see LICENSE for more information. Maintained by SpiralScout.