The short-style syntax does make arrays much more readable, as it no longer
makes them look like function calls.
However, the rule you're referencing is for when you are keeping arguments on
the *same* line. It permits for splitting an array in that signature to
multiple lines, and continuing the signature after the end of the multi-line
array.
i see now your first example was following the guideline of the format from
your second message. Your right, technically that does comply with the
standard. When you start the signature on the same line as the opening "(", all
successive arguments after should continue on the line where the previous
argument ends. But hopefully you can see how muddled that pattern is for
readability. It's hard to tell where the arrays begin or end, particularly in
context of being function arguments. So many commas and brackets...
Honestly, i dislike the standard's allowance of the style in your second
message. It seems very awkward and visually clunky to me. But i don't have a
vote in accepting the standard, and came to the group a bit late to make a case
for changing it. For me (and the guide my team uses), any time any argument is
split to multiple lines, the whole signature should follow the multi-line
signature rule.
Ultimately, i think the goal is readable & maintainable code, so when two
versions are technically legal, let that objective be the deciding factor.
Hope that helps.
-jlt
--
You received this message because you are subscribed to the Google Groups "PHP
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/php-fig/a6a5cb9e-3055-492b-81ae-30be272dcd9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.