Skip to content

Commit b42c5b0

Browse files
authored
Merge pull request #10 from chadicus/develop
Update coding standard to only require phpdoc for public methods
2 parents 0dbbe6c + 940d7f6 commit b42c5b0

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
final class Chadicus_Sniffs_Commenting_FunctionCommentSniff extends Squiz_Sniffs_Commenting_FunctionCommentSniff
4+
{
5+
/**
6+
* Ensures only public methods are processed.
7+
*
8+
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
9+
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
10+
*
11+
* @return void
12+
*/
13+
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
14+
{
15+
$methodProperties = $phpcsFile->getMethodProperties($stackPtr);
16+
if ($methodProperties['scope'] !== 'public') {
17+
return;
18+
}
19+
20+
parent::process($phpcsFile, $stackPtr);
21+
}
22+
}

Chadicus/ruleset.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />
1111
<rule ref="Generic.ControlStructures.InlineControlStructure" />
1212
<rule ref="Squiz.Commenting.DocCommentAlignment" />
13-
<rule ref="Squiz.Commenting.FunctionComment" />
1413
<rule ref="Squiz.Commenting.FunctionCommentThrowTag" />
1514
<rule ref="Squiz.Commenting.VariableComment" />
1615
<rule ref="Generic.Commenting.Fixme" />

0 commit comments

Comments
 (0)