Skip to content

Commit 630b023

Browse files
Merge pull request #4 from cybex-gmbh/fix/backtrace-null-parameter
Fix passing a null parameter to debug_backtrace
2 parents e5c1802 + 2f24a10 commit 630b023

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

config/query-tracer.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@
124124
| Backtrace Frame Limit
125125
|--------------------------------------------------------------------------
126126
|
127-
| Setting this limit to any non-null value greater than 0 will limit the
128-
| amount of stack frames to parse. Depending on the application and your
129-
| restriction settings, a good value might be between 8 and 25. If in
130-
| doubt, leave this setting unlimited as long as you don't experience
131-
| serious performance or memory consumption issues.
127+
| Setting this limit to any value greater than 0 will limit the amount
128+
| of stack frames to parse. Depending on the application and your
129+
| restriction settings, a good value might be between 8 and 25.
130+
| If in doubt, leave this setting unlimited as long as you do
131+
| not experience performance or memory consumption issues.
132132
|
133133
*/
134-
'limit' => null,
134+
'limit' => 0,
135135

136136
/*
137137
|--------------------------------------------------------------------------

src/Classes/StackTrace.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function getLastMatchingStackFrame(): ?ArrayIterator
9090
$excludeContaining = (array)config('query-tracer.backtrace.excludeFilesContaining');
9191

9292
$fullBacktrace = debug_backtrace(
93-
config('query-tracer.backtrace.withArgs') ? 1 : DEBUG_BACKTRACE_IGNORE_ARGS,
93+
DEBUG_BACKTRACE_PROVIDE_OBJECT | (config('query-tracer.backtrace.withArgs') ? false : DEBUG_BACKTRACE_IGNORE_ARGS),
9494
config('query-tracer.backtrace.limit')
9595
);
9696

@@ -135,7 +135,7 @@ protected function getCall(array $stackFrame, bool $withClass = true): string
135135

136136
$args = '';
137137

138-
if (is_array($stackFrame['args']) && count($stackFrame['args'])) {
138+
if (is_array($stackFrame['args'] ?? false) && count($stackFrame['args'])) {
139139
$args = app('trace.formatter.argument')->formatStackFrameArguments(array_values($stackFrame['args']));
140140
}
141141

0 commit comments

Comments
 (0)