plugin-php
plugin-php copied to clipboard
Symfony #[Route] Formatting Bug
The formatting of #[Route] lines are broken, I think. It tends to spread out over multiple lines when it could neatly fit into just one.
Input
#[Route('route/path', name: 'very_very_very_very_very_very_long_route_name', methods: ['GET'])]
Output
#[
Route('
'route/path',
name: 'very_very_very_very_very_very_long_route_name',
methods: ['GET']
)
]
Following PER CS 2.0 we should never have a line break after #[ and before the closing ]
Made a similar discovery. If you haven't resolved it already, maybe it looks like that since the print width is defaulted to 80 characters. Your line seems to be 95 characters long which is why prettier would format it that way?