Skip to content

Commit 0ce0d88

Browse files
committed
updated docs
1 parent 35e5e7a commit 0ce0d88

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

StellarWP/Sniffs/Whitespace/DocCommentSpacingSniff.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@
1111
* @package StellarWP\Sniffs\Whitespace
1212
*/
1313
final class DocCommentSpacingSniff implements Sniff {
14+
/**
15+
* Register the sniff.
16+
*
17+
* @return array<string>
18+
*/
1419
public function register() {
1520
return [ T_DOC_COMMENT_TAG ];
1621
}
1722

23+
/**
24+
* Process the doc comment.
25+
*
26+
* @param File $phpcsFile The file being scanned.
27+
* @param int $stackPtr The position of the current token in the stack.
28+
*/
1829
public function process( File $phpcsFile, $stackPtr ) {
1930
$tokens = $phpcsFile->getTokens();
2031
$full_tag = $tokens[ $stackPtr ]['content'];
@@ -52,6 +63,14 @@ public function process( File $phpcsFile, $stackPtr ) {
5263
}
5364
}
5465

66+
/**
67+
* Fix the spacing issue in the doc comment.
68+
*
69+
* @param File $phpcsFile The file being scanned.
70+
* @param int $stackPtr The position of the current token in the stack.
71+
* @param string $tag The tag name.
72+
* @param string $version The version number.
73+
*/
5574
private function fixSpacing( File $phpcsFile, $stackPtr, $tag, $version ) {
5675
$correctedComment = sprintf( '%s %s', $tag, $version );
5776

@@ -60,6 +79,12 @@ private function fixSpacing( File $phpcsFile, $stackPtr, $tag, $version ) {
6079
$phpcsFile->fixer->endChangeset();
6180
}
6281

82+
/**
83+
* Fix the multiple space trails in the doc comment.
84+
*
85+
* @param File $phpcsFile The file being scanned.
86+
* @param int $stackPtr The position of the current token in the stack.
87+
*/
6388
private function fixMultipleSpaces( File $phpcsFile, $stackPtr ) {
6489
$phpcsFile->fixer->beginChangeset();
6590
$phpcsFile->fixer->replaceToken( $stackPtr, " " );

0 commit comments

Comments
 (0)