function DebugScope::formatBacktrace
2 calls to DebugScope::formatBacktrace()
- DebugScope::detach in vendor/
open-telemetry/ context/ DebugScope.php - Detaches the context associated with this scope and restores the previously associated context.
- DebugScope::__destruct in vendor/
open-telemetry/ context/ DebugScope.php
File
-
vendor/
open-telemetry/ context/ DebugScope.php, line 104
Class
- DebugScope
- @internal
Namespace
OpenTelemetry\ContextCode
private static function formatBacktrace(array $trace) : string {
$s = '';
for ($i = 0, $n = count($trace) + 1; ++$i < $n;) {
$s .= "\n\t";
$s .= 'at ';
if (isset($trace[$i]['class'])) {
$s .= strtr($trace[$i]['class'], [
'\\' => '.',
]);
$s .= '.';
}
$s .= strtr($trace[$i]['function'] ?? '{main}', [
'\\' => '.',
]);
$s .= '(';
if (isset($trace[$i - 1]['file'])) {
$s .= basename((string) $trace[$i - 1]['file']);
if (isset($trace[$i - 1]['line'])) {
$s .= ':';
$s .= $trace[$i - 1]['line'];
}
}
else {
$s .= 'Unknown Source';
}
$s .= ')';
}
return $s . "\n";
}