1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-25 10:41:55 +02:00

Check file (#599)

* Check file

* Check line
This commit is contained in:
Barry vd. Heuvel
2024-02-15 11:49:09 +01:00
committed by GitHub
parent 512fb06c48
commit 484625c23a

View File

@@ -70,7 +70,7 @@ class MessagesCollector extends AbstractLogger implements DataCollectorInterface
$stacktrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 5);
$stackItem = $stacktrace[0];
foreach ($stacktrace as $trace) {
if (strpos($trace['file'], '/vendor/') !== false) {
if (!isset($trace['file']) || strpos($trace['file'], '/vendor/') !== false) {
continue;
}
@@ -85,7 +85,7 @@ class MessagesCollector extends AbstractLogger implements DataCollectorInterface
'is_string' => $isString,
'label' => $label,
'time' => microtime(true),
'xdebug_link' => $stackItem ? $this->getXdebugLink($stackItem['file'], $stackItem['line']) : null,
'xdebug_link' => $stackItem ? $this->getXdebugLink($stackItem['file'], $stackItem['line'] ?? null) : null,
);
}