forked from lesstif/php-JiraCloud-RESTAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDumper.php
More file actions
33 lines (29 loc) · 744 Bytes
/
Copy pathDumper.php
File metadata and controls
33 lines (29 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
namespace JiraCloud;
use Symfony\Component\VarDumper\Cloner\VarCloner;
use Symfony\Component\VarDumper\Dumper\CliDumper;
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
class Dumper
{
/**
* Dump a value with elegance.
*
* @param mixed $value
*/
public static function dump($value)
{
if (class_exists(CliDumper::class)) {
$dumper = 'cli' === PHP_SAPI ? new CliDumper() : new HtmlDumper();
$dumper->dump((new VarCloner())->cloneVar($value));
} else {
var_dump($value);
}
}
public static function dd($x)
{
array_map(function ($x) {
(new self())->dump($x);
}, func_get_args());
exit(1);
}
}