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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
use ComponentVarDumperClonerVarCloner; use ComponentVarDumperDumperCliDumper; use ComponentVarDumperDumperhtmlDumper as SymfonyHtmlDumper;
class HtmlDumper extends SymfonyHtmlDumper { 大专栏 PHP 全局使用 Laravel 辅助函数 ddnt"> * Colour definitions for output.
protected $styles = [ 'default' => 'background-color:#fff; color:#222; line-height:1.2em; font-weight:normal; font:12px Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:100000', 'num' => 'color:#a71d5d', 'const' => 'color:#795da3', 'str' => 'color:#df5000', 'cchr' => 'color:#222', 'note' => 'color:#a71d5d', 'ref' => 'color:#a0a0a0', 'public' => 'color:#795da3', 'protected' => 'color:#795da3', 'private' => 'color:#795da3', 'meta' => 'color:#b729d9', 'key' => 'color:#df5000', 'index' => 'color:#a71d5d', ]; }
class Dumper {
public 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); } } }
if (! function_exists('dd')) {
function dd(...$args) { foreach ($args as $x) { (new Dumper)->dump($x); } die(1); } }
if (! function_exists('dda')) {
function dda(...$args) { foreach ($args as $x) { (new Dumper)->dump($x->toArray()); } die(1); } }
|