Appearance
CodeSpreader
php
final readonly class Zairakai\LaravelDevTools\Services\CodeSpreaderWrites on several lines what the handbook asks to spread (standards/php.md): every array that is not empty, a call of more than two arguments and a function of more than two parameters. One element, argument or parameter per line, a trailing comma, the indentation of the line. The destructurings ([$a, $b] = ...) and the list() and array() forms are left as they are.
Pint then aligns the =>. The source is returned unchanged when it cannot be parsed.
What to spread is found by ArrayEdits, CallEdits and ParameterEdits (one kind of node each); this class applies their edits, round after round, until nothing is left to spread.
Source: src/Services/CodeSpreader.php
Methods
__construct()
php
public function __construct(Parser $parser = null)spread()
php
public function spread(string $source): stringReturns string the source with its arrays and its calls spread, until nothing is left to spread