File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php 
2+ 
3+ 
4+ namespace  SwooleTW \Http \Helpers ;
5+ 
6+ 
7+ class  Dump
8+ {
9+     // define the dumper class 
10+     protected  static  $ dumper_class'Symfony\Component\VarDumper\Dumper\HtmlDumper ' ;
11+     protected  static  $ cloner_class'Symfony\Component\VarDumper\Cloner\VarCloner ' ;
12+ 
13+     public  static  function  dd (...$ args
14+ 
15+         // only works when these classes are existing 
16+         // otherwise return false 
17+         if  (!class_exists (static ::$ dumper_classclass_exists (static ::$ cloner_class
18+             return  false ;
19+         }
20+ 
21+         // init the dumper and cloner 
22+         $ dumpernew  static::$ dumper_class
23+         $ clonernew  static::$ cloner_class
24+ 
25+         // dump each var in the args 
26+         foreach  ($ argsas  $ arg
27+             if  (defined ('IN_PHPUNIT ' )) {
28+                 continue ;
29+             }
30+             $ dumperdump ($ clonercloneVar ($ arg
31+         }
32+ 
33+         return  true ;
34+     }
35+ }
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments