File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
src/Understand/UnderstandLaravel Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ protected function getStackTraceFile(array $trace)
9191 */
9292 protected function stackTraceCallToString (array $ trace )
9393 {
94- if (!isset ($ trace ['type ' ]))
94+ if (! isset ($ trace ['type ' ]))
9595 {
9696 return 'function ' ;
9797 }
@@ -117,6 +117,11 @@ protected function stackTraceArgsToArray(array $trace)
117117 {
118118 $ params = [];
119119
120+ if (! isset ($ trace ['args ' ]))
121+ {
122+ return $ params ;
123+ }
124+
120125 foreach ($ trace ['args ' ] as $ arg )
121126 {
122127 if (is_array ($ arg ))
Original file line number Diff line number Diff line change @@ -42,4 +42,14 @@ public function testEmptyExceptionMessageCase()
4242 $ this ->assertSame ('DomainException ' , $ exceptionArray ['message ' ]);
4343 }
4444
45+ public function testStactTraceSerializationWithoutArgs ()
46+ {
47+ $ stackTrace = debug_backtrace ();
48+ unset($ stackTrace [0 ]['args ' ]);
49+
50+ $ encoder = new Understand \UnderstandLaravel \ExceptionEncoder ();
51+ $ stackTraceArray = $ encoder ->stackTraceToArray ($ stackTrace );
52+
53+ $ this ->assertEmpty ($ stackTraceArray [0 ]['args ' ]);
54+ }
4555}
You can’t perform that action at this time.
0 commit comments