Appearance
SpreadBlock
php
final readonly class Zairakai\LaravelDevTools\Services\Spread\SpreadBlockWrites 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
| Name | Value | Description |
|---|---|---|
INDENT | ' ' | |
MIN_SPREAD | 3 | A 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): stringThe 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): stringwrite()
php
public static function write(string $open, array $elements, string $close, string $indent, string $source, array $lines): stringThe elements one per line, with a trailing comma, in the indentation of the line.