This repository was archived by the owner on Sep 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +30
-2
lines changed
Expand file tree Collapse file tree 1 file changed +30
-2
lines changed Original file line number Diff line number Diff line change 2727 return $ data ;
2828 })
2929 ->addFilter ('methods ' , function ($ data , $ filterParams ) {
30- if (\is_object ($ data ) && !empty ($ data )) {
31- $ data = get_class_methods ($ data );
30+ if (\is_object ($ data )) {
31+ $ data = \get_class_methods ($ data );
32+ echo '<pre> ' ;
33+ print_r ($ data );
34+ echo '</pre> ' ;
35+ }
36+
37+ return $ data ;
38+ })
39+ ->addFilter ('classPath ' , function ($ data , $ filterParams ) {
40+ if (\is_object ($ data ) || \class_exists ($ data )) {
41+ $ reflectionClass = new \ReflectionClass ($ data );
42+ $ data = [
43+ 'file_name ' => $ reflectionClass ->getFileName (),
44+ 'start_line ' => $ reflectionClass ->getStartLine ()
45+ ];
46+ }
47+
48+ return $ data ;
49+ })
50+ ->addFilter ('props ' , function ($ data , $ filterParams ) {
51+ if (\is_object ($ data )) {
52+ $ data = \get_object_vars ($ data );
3253 }
3354
3455 return $ data ;
5879 $ data = array_pop ($ data );
5980 }
6081
82+ return $ data ;
83+ })
84+ ->addFilter ('filter ' , function ($ data , $ filterParams ) {
85+ if (!empty ($ filterParams [0 ]) && \is_callable ($ filterParams [0 ])) {
86+ $ data = $ filterParams [0 ]($ data );
87+ }
88+
6189 return $ data ;
6290 });
You can’t perform that action at this time.
0 commit comments