Please give example code for preserve_breaking_attribute_list formatting option #189
-
|
Please give example code for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi! The Given: #[
Route('/user')
]
class UserController
{
// ...
}Mago will format this as: #[Route('/user')]
class UserController
{
// ...
}As the attribute list can fit into a single line. However, with #[
Route('/user'),
]
class UserController
{
// ...
}The preserve options are useful if you want to have more control over breaking things into multiple lines, by telling Mago that if something is already spanning multiple lines, keep it as is. Options are avaialble for argument lists ( |
Beta Was this translation helpful? Give feedback.
Hi!
The
preserve_*options control wheather or not mago formatter will keep elements broken into multiple lines or not when formatting.Given:
Mago will format this as:
As the attribute list can fit into a single line.
However, with
preserve_breaking_attribute_listoption enabled. Mago will keep the attribute list broken into multiple lines, such as:The preserve options are useful if you want to have more control over breaking things into multiple lines, by telling Mago that if something is already spanning multiple lines, …