Closed bobbrodie closed 7 years ago
@bobbrodie thanks for your reporting. This issue is caused by conflicting rules in MEQP1 ruleset. We should mark <rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
with severity 0. So the correct multi-line declaration is:
public function functionWithManyParams(
$parameter1,
$parameter2 = array(),
$parameter3 = 'custom',
$parameter4 = false,
$parameter5 = '',
$parameter6 = null,
$parameter7 = false,
$parameter8 = false
) {
Let's say you have a multi-line function with long parameter names that would force you to go over 120 characters. The rules say that if you're going to line-break, you need to do one parameter per line.
Since this is a multi-line function, the closing parenthesis must be on its own line, sure. Then, the opening brace needs to be on a new line.
So we run into this:
This is not valid:
Nor is this:
I know there's something to be said for the number of parameters, but the issue at hand is that this is throwing a warning.
Am I completely missing something here?