Documentation

functions.php

Table of Contents

Functions

startContext()  : Context<TReceive, TSend>
contextFactory()  : ContextFactory
Gets or sets the global context factory.
flattenThrowableBacktrace()  : array<int, FlattenedTraceEntry>
formatFlattenedBacktrace()  : string
flattenArgument()  : string

Functions

startContext()

startContext(string|array<int, string> $script[, Cancellation|null $cancellation = null ]) : Context<TReceive, TSend>
Parameters
$script : string|array<int, string>

Path to PHP script or array with first element as path and following elements as options to the PHP script (e.g.: ['bin/worker', 'Option1Value', 'Option2Value'].

$cancellation : Cancellation|null = null
Tags
template
template
template
Return values
Context<TReceive, TSend>

flattenThrowableBacktrace()

flattenThrowableBacktrace(Throwable $exception) : array<int, FlattenedTraceEntry>
Parameters
$exception : Throwable
Tags
psalm-type

FlattenedTraceEntry = array<non-empty-string, scalar|list>

Return values
array<int, FlattenedTraceEntry>

Serializable exception backtrace, with all function arguments flattened to strings.

formatFlattenedBacktrace()

formatFlattenedBacktrace(array<string|int, mixed> $trace) : string
Parameters
$trace : array<string|int, mixed>

Backtrace produced by flattenThrowableBacktrace().

Return values
string

flattenArgument()

flattenArgument(mixed $value) : string
Parameters
$value : mixed
Return values
string

Serializable string representation of $value for backtraces.


        
On this page

Search results