Open susnux opened 2 weeks ago
Change the method_argument_space rule to following:
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline']
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 }
While I like it for the constructor, I really prefer not to have it on all the other methods. It will be a huge waste of space.
I missed the on_multiline: Talk diff looks solid
on_multiline
sounds good 👍
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:
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:
After: