File tree Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,10 @@ public function getName(): string
3333
3434 protected function applyPipeCollect ()
3535 {
36- $ pipedCollect = collect ($ this ->collect ())
37- ->when ($ this ->pipe , function (Collection $ collects ) {
38- return $ collects ->pipe ($ this ->pipe );
39- });
40-
41- return collect ($ pipedCollect )
36+ return collect ($ this ->collect ())
37+ ->when ($ this ->pipe , function (Collection $ collects ) {
38+ return collect ($ collects ->pipe ($ this ->pipe ));
39+ })
4240 ->filter (function ($ item ) {
4341 return ! blank ($ item );
4442 })
@@ -47,6 +45,9 @@ protected function applyPipeCollect()
4745
4846 public function __toString ()
4947 {
50- return (string ) var_output ($ this ->applyPipeCollect (), true );
48+ return (string ) json_encode (
49+ $ this ->applyPipeCollect (),
50+ JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT
51+ );
5152 }
5253}
Original file line number Diff line number Diff line change @@ -24,18 +24,16 @@ public function __construct(callable $pipe = null)
2424 parent ::__construct ();
2525 $ this ->pipe = $ pipe
2626 ?: function (Collection $ traces ) {
27- return $ traces ->filter (function ($ trace ) {
28- return ! Str::contains ($ trace , 'vendor ' );
29- });
27+ return $ traces
28+ ->filter (function ($ trace ) {
29+ return ! Str::contains ($ trace , 'vendor ' );
30+ })
31+ ->values ();
3032 };
3133 }
3234
3335 public function collect ()
3436 {
35- return collect (explode ("\n" , $ this ->exception ->getTraceAsString ()))
36- ->transform (function ($ trace , $ index ) {
37- return ltrim ($ trace , "# $ index " );
38- })
39- ->all ();
37+ return explode ("\n" , $ this ->exception ->getTraceAsString ());
4038 }
4139}
You can’t perform that action at this time.
0 commit comments