Componette

Componette

jvitasek

jvitasek / DumpAndDie

☠️ DumpAndDie: Laravel's dd function ported to Nette Tracy

download-cloud-line composer require jvitasek/dumpanddie

DumpAndDie: Laravel dd() function in Tracy

Total Downloads Version

dd() is a function in Laravel used to dump one or more variables and die. This is the implementation supporting this functionality in the Tracy Panel (from Nette Framework debugger).

Installation

The best way to install jvitasek/DumpAndDie is using Composer:

$ composer require jvitasek/dumpanddie

Usage in browser

<?php declare(strict_types = 1);

use Nette\Application\UI\Presenter;

final class TestPresenter extends Presenter {

    public function actionDefault(): void
    {
        $price = 42;
        $filename = sha1((string) ($price + time())) . '.log';
        
        // write this
        dd($price, $filename);
        
        // instead of this
        \Tracy\Debugger::barDump($price);
        \Tracy\Debugger::barDump($filename);
        die(1);
    }

}

Usage in CLI

<?php declare(strict_types = 1);

use Tracy\Debugger;

require __DIR__ . '/../vendor/autoload.php';
Debugger::enable(Debugger::DEVELOPMENT);
$price = 42;
$filename = sha1((string) ($price + time())) . '.log';
dd($price, $filename);

No release at this moment. Try to create first one.

bar-chart-fill

Statistics

download-cloud-fill
93
star-fill
1
bug-fill
0
flashlight-fill
176d
price-tag-2-line

Badges

guide-fill

Dependencies

Componette Componette felix@nette.org