Skip to content

Commit 7a47e82

Browse files
rodrigoprimojrfnl
authored andcommitted
Generic/FunctionCallArgumentSpacing: fix code examples in the XML doc
The code examples in the XML documentation of this sniff were incorrect as the sniff does not check spacing in function argument definitions. It only checks spacing in function and method calls. As far as I could check this has always been the case, or at least it has been the case for a long time. Since tests were added for this sniff when it was part of the PEAR standard and called MethodCallArgumentSpacing, it ignored function definitions and checked only function calls: squizlabs/PHP_CodeSniffer@7b84951#diff-56e2f69852c3071fbf86d20fbb49f38dae17cff8731154d8b1b7495c4ad8eeb0R24-R27 Here is the sniff code where it ignores function definitions: https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/57a9ed734e2ab06c062fe0e463745eab483cf722/src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php#L55-L66
1 parent a80fde9 commit 7a47e82

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Standards/Generic/Docs/Functions/FunctionCallArgumentSpacingStandard.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,12 @@
77
<code_comparison>
88
<code title="Valid: Single spaces after a comma.">
99
<![CDATA[
10-
function foo($bar,<em> </em>$baz)
11-
{
12-
}
10+
foo($bar,<em> </em>$baz);
1311
]]>
1412
</code>
1513
<code title="Invalid: No spaces after a comma.">
1614
<![CDATA[
17-
function foo($bar,<em></em>$baz)
18-
{
19-
}
15+
foo($bar,<em></em>$baz);
2016
]]>
2117
</code>
2218
</code_comparison>

0 commit comments

Comments
 (0)