RingBuffer
Playwright\Transport\RingBuffer
Fixed-size ring buffer for capturing recent stderr/stdout lines. Useful for debugging failed processes by keeping the most recent output.
Methods
__construct()
function __construct( private readonly int $max = 200, )
push()
voidAdd a line to the buffer, automatically trimming old lines if needed.
function push(string $line): void
clear()
voidClear all lines from the buffer.
function clear(): void
toString()
stringGet all lines as a single string.
function toString(string $separator = PHP_EOL): string
toArray()
arrayGet all lines as an array.
function toArray(): array
count()
intGet the number of lines in the buffer.
function count(): int
isEmpty()
boolCheck if the buffer is empty.
function isEmpty(): bool
getMaxSize()
intGet the maximum capacity of the buffer.
function getMaxSize(): int