Skip to content

Commit

Permalink
dump multiple values
Browse files Browse the repository at this point in the history
markhuot committed Nov 17, 2023
1 parent b34d8b7 commit 3517eeb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/helpers/Test.php
Original file line number Diff line number Diff line change
@@ -33,15 +33,17 @@ function test()

// The default dump() and dd() methods that ship with Craft don't play well with Pest so
// set the correct versions early
function dump($args)
function dump(...$args)
{
$cloner = new \Symfony\Component\VarDumper\Cloner\VarCloner;
$dumper = new \Symfony\Component\VarDumper\Dumper\CliDumper;
$dumper->dump($cloner->cloneVar($args));
foreach ($args as $arg) {
$dumper->dump($cloner->cloneVar($arg));
}
}

function dd($args)
function dd(...$args)
{
dump($args);
dump(...$args);
die;
}

0 comments on commit 3517eeb

Please sign in to comment.