plugin-php
plugin-php copied to clipboard
Format multiple-catch
We're currently not respecting line length limitations in multiple-catch blocks, which we could.
@prettier/plugin-php v0.14.0 Playground link
Input:
<?php
try {
do_something();
} catch (\Some\Rather\Obscure\Exception | \Another\Obscure\Exception $exception) {
handle_exception();
}
Current Output:
<?php
try {
do_something();
} catch (\Some\Rather\Obscure\Exception | \Another\Obscure\Exception $exception) {
handle_exception();
}
Improved Output:
<?php
try {
do_something();
} catch (
\Some\Rather\Obscure\Exception |
\Another\Obscure\Exception $exception
) {
handle_exception();
}
To be honest, the improved output is not perfect (the $exception variable is a little bit "obscured" next to the exception class), but it's better than the current behavior IMO.
I am also experiencing this.