File tree Expand file tree Collapse file tree 2 files changed +38
-35
lines changed Expand file tree Collapse file tree 2 files changed +38
-35
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace SwooleTW \Http \Helpers ;
4+
5+ use Symfony \Component \VarDumper \Cloner \VarCloner ;
6+ use Symfony \Component \VarDumper \Dumper \CliDumper ;
7+ use Symfony \Component \VarDumper \Dumper \HtmlDumper ;
8+
9+ class VarDumper
10+ {
11+ protected static $ cloner ;
12+
13+ public static function dump (...$ args )
14+ {
15+ if (! static ::$ cloner instanceOf VarCloner) {
16+ static ::$ cloner = new VarCloner ;
17+ }
18+
19+ $ dumper = static ::getDumper ();
20+
21+ foreach ($ args as $ arg ) {
22+ $ dumper ->dump (
23+ static ::$ cloner ->cloneVar ($ arg )
24+ );
25+ }
26+
27+ return true ;
28+ }
29+
30+ public static function getDumper ()
31+ {
32+ $ dumper = defined ('IN_PHPUNIT ' ) || ! config ('swoole_http.ob_output ' )
33+ ? CliDumper::class
34+ : HtmlDumper::class;
35+
36+ return new $ dumper ;
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments