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

Breadcrumb

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

function TracingDriver::formatStacktrace

Formats a stacktrace obtained via `debug_backtrace()`.

Parameters

list<array{: args?: list<mixed>, class?: class-string, file?: string, function: string, line?: int, object?: object, type?: string }> $trace Output of `debug_backtrace()`.

Return value

string Formatted stacktrace.

7 calls to TracingDriver::formatStacktrace()
TracingDriver::cancel in vendor/revolt/event-loop/src/EventLoop/Driver/TracingDriver.php
Cancel a callback.
TracingDriver::defer in vendor/revolt/event-loop/src/EventLoop/Driver/TracingDriver.php
Defer the execution of a callback.
TracingDriver::delay in vendor/revolt/event-loop/src/EventLoop/Driver/TracingDriver.php
Delay the execution of a callback.
TracingDriver::onReadable in vendor/revolt/event-loop/src/EventLoop/Driver/TracingDriver.php
Execute a callback when a stream resource becomes readable or is closed for reading.
TracingDriver::onSignal in vendor/revolt/event-loop/src/EventLoop/Driver/TracingDriver.php
Execute a callback when a signal is received.

... See full list

File

vendor/revolt/event-loop/src/EventLoop/Driver/TracingDriver.php, line 264

Class

TracingDriver

Namespace

Revolt\EventLoop\Driver

Code

private function formatStacktrace(array $trace) : string {
    return \implode("\n", \array_map(static function ($e, $i) {
        $line = "#{$i} ";
        if (isset($e["file"], $e['line'])) {
            $line .= "{$e['file']}:{$e['line']} ";
        }
        if (isset($e["class"], $e["type"])) {
            $line .= $e["class"] . $e["type"];
        }
        return $line . $e["function"] . "()";
    }, $trace, \array_keys($trace)));
}

API Navigation

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