Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,38 +1,18 @@
<documentation title="Function Argument Spacing">
<documentation title="Function Call Argument Spacing">
<standard>
<![CDATA[
Function arguments should have one space after a comma, and single spaces surrounding the equals sign for default values.
There should be no space before and exactly one space, or a new line, after a comma when passing arguments to a function or method.
]]>
</standard>
<code_comparison>
<code title="Valid: Single spaces after a comma.">
<code title="Valid: No space before and exactly one space after a comma.">
<![CDATA[
function foo($bar,<em> </em>$baz)
{
}
foo($bar,<em> </em>$baz);
]]>
</code>
<code title="Invalid: No spaces after a comma.">
<code title="Invalid: A space before and no space after a comma.">
<![CDATA[
function foo($bar,<em></em>$baz)
{
}
]]>
</code>
</code_comparison>
<code_comparison>
<code title="Valid: Single spaces around an equals sign in function declaration.">
<![CDATA[
function foo($bar, $baz<em> </em>=<em> </em>true)
{
}
]]>
</code>
<code title="Invalid: No spaces around an equals sign in function declaration.">
<![CDATA[
function foo($bar, $baz<em></em>=<em></em>true)
{
}
foo($bar<em> </em>,<em></em>$baz);
]]>
</code>
</code_comparison>
Expand Down