Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DebugScope.php

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\Context

Code

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";
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal