Skip to content
Discussion options

You must be logged in to vote

Hi!

The preserve_* options control wheather or not mago formatter will keep elements broken into multiple lines or not when formatting.

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 preserve_breaking_attribute_list option enabled. Mago will keep the attribute list broken into multiple lines, such as:

#[
   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, …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@trymeouteh
Comment options

Answer selected by azjezz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants