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.
File
-
vendor/
revolt/ event-loop/ src/ EventLoop/ Driver/ TracingDriver.php, line 264
Class
Namespace
Revolt\EventLoop\DriverCode
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)));
}