Skip to content

SpreadBlock ​

php
final readonly class Zairakai\LaravelDevTools\Services\Spread\SpreadBlock

Writes the elements of an array, the arguments of a call or the parameters of a function on several lines.

Source: src/Services/Spread/SpreadBlock.php

Constants ​

NameValueDescription
INDENT' '
MIN_SPREAD3A call or a function with fewer than this number of arguments or parameters stays on one line.

Methods ​

closing() ​

php
public static function closing(string $source, int $endPosition): string

The closing parenthesis that follows the end of the last argument or parameter (a trailing comma is allowed), with what lies before it, or null when the call does not close right after it.

indentOf() ​

php
public static function indentOf(array $lines, int $line): string

write() ​

php
public static function write(string $open, array $elements, string $close, string $indent, string $source, array $lines): string

The elements one per line, with a trailing comma, in the indentation of the line.

Documentation of 5.5.0 , built from 92a7387 on 5.5.0 by pipeline #3086393151 on 2026-11-18.