Skip to content

Proposal: Change method_argument_space to ensure fully multiline #42

Open
@susnux

Description

@susnux

Summary

Change the method_argument_space rule to following:

'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline']

Reasons

One of the most common refactoring I see is the following:

-public function __construct(LoggerInterface $logger,
+public function __construct(
+	LoggerInterface $logger,
-	IEventDispatcher $dispatcher) {
+ 	IEventDispatcher $dispatcher,
+) {
// something
}

I also think it makes sense to have this formatting to reduce the diff if you add another dependency to the constructor, e.g.:

Before:

public function __construct(LoggerInterface $logger,
-	IEventDispatcher $dispatcher) {
+ 	IEventDispatcher $dispatcher,
+ 	IURLGenerator $urlGenerator) {
// something
}

After:

public function __construct(
	LoggerInterface $logger,
	IEventDispatcher $dispatcher,
+ 	IURLGenerator $urlGenerator,
) {
// something
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions