Skip to content

Commit

Permalink
Merge pull request #206 from Yoast/JRF/CS/use-_un_qualified-names-in-…
Browse files Browse the repository at this point in the history
…docblocks-1

CS: use *un*qualified names in docblocks
  • Loading branch information
jrfnl authored Apr 8, 2020
2 parents a1ed211 + e709263 commit a9f49f3
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 51 deletions.
5 changes: 2 additions & 3 deletions Yoast/Sniffs/Commenting/CodeCoverageIgnoreDeprecatedSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ public function register() {
/**
* Processes this test, when one of its tokens is encountered.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
*
* @return void
*/
Expand Down
26 changes: 11 additions & 15 deletions Yoast/Sniffs/Commenting/CoversTagSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ public function register() {
/**
* Processes this test, when one of its tokens is encountered.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
*
* @return void
*/
Expand Down Expand Up @@ -266,12 +265,11 @@ public function process( File $phpcsFile, $stackPtr ) {
/**
* Add a fixable error if a suitable alternative is available.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param string $expected The expected alternative annotation.
* This annotation might not be valid itself.
* @param string $errorCode The error code.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
* @param string $expected The expected alternative annotation.
* This annotation might not be valid itself.
* @param string $errorCode The error code.
*
* @return bool Whether an error has been thrown or not.
*/
Expand Down Expand Up @@ -302,12 +300,10 @@ protected function fixSimpleError( File $phpcsFile, $stackPtr, $expected, $error
/**
* Add a fixable error for a union/intersect @covers annotation.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param string $errorCode The error code.
* @param string $separator The separator to split the
* annotation on.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
* @param string $errorCode The error code.
* @param string $separator The separator to split the annotation on.
*
* @return bool Whether to skip the rest of the annotation examination or not.
*/
Expand Down
5 changes: 2 additions & 3 deletions Yoast/Sniffs/Commenting/FileCommentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ class FileCommentSniff extends Squiz_FileCommentSniff {
/**
* Processes this test, when one of its tokens is encountered.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
*
* @return int Stack pointer to skip the rest of the file.
*/
Expand Down
15 changes: 6 additions & 9 deletions Yoast/Sniffs/Commenting/TestsHaveCoversTagSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ public function register() {
/**
* Processes this test, when one of its tokens is encountered.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
*
* @return void|int Optionally returns a stack pointer. This sniff will not be
* called again on the current file until the returned stack
Expand All @@ -55,9 +54,8 @@ public function process( File $phpcsFile, $stackPtr ) {
/**
* Processes the docblock for a class token.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
*
* @return void|int If covers annotations were found (or this is not a test class),
* will return the stack pointer to the end of the class.
Expand Down Expand Up @@ -120,9 +118,8 @@ protected function process_class( File $phpcsFile, $stackPtr ) {
/**
* Processes the docblock for a function token.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
*
* @return void
*/
Expand Down
5 changes: 2 additions & 3 deletions Yoast/Sniffs/ControlStructures/IfElseDeclarationSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ public function register() {
/**
* Processes this test, when one of its tokens is encountered.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
*
* @return void
*/
Expand Down
10 changes: 4 additions & 6 deletions Yoast/Sniffs/Files/FileNameSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ public function register() {
/**
* Processes this test, when one of its tokens is encountered.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
*
* @return int StackPtr to the end of the file, this sniff needs to only
* check each file once.
Expand Down Expand Up @@ -201,9 +200,8 @@ public function process( File $phpcsFile, $stackPtr ) {
/**
* Check if the file is on the exclude list.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param string $path_to_file The full path to the file
* currently being examined.
* @param File $phpcsFile The file being scanned.
* @param string $path_to_file The full path to the file currently being examined.
*
* @return bool
*/
Expand Down
5 changes: 2 additions & 3 deletions Yoast/Sniffs/Files/TestDoublesSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ public function register() {
/**
* Processes this test, when one of its tokens is encountered.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
*
* @return void|int Void or $stackPtr to the end of the file if no basepath was set
* or no valid doubles_path(s) were found.
Expand Down
5 changes: 2 additions & 3 deletions Yoast/Sniffs/Namespaces/NamespaceDeclarationSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ public function register() {
/**
* Processes this test, when one of its tokens is encountered.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
*
* @return int Stack pointer to skip the rest of the file.
*/
Expand Down
5 changes: 2 additions & 3 deletions Yoast/Sniffs/NamingConventions/NamespaceNameSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ protected function filter_prefixes( $prefixes ) {
/**
* Processes this test, when one of its tokens is encountered.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
*
* @return void
*/
Expand Down
5 changes: 2 additions & 3 deletions Yoast/Sniffs/WhiteSpace/FunctionSpacingSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ class FunctionSpacingSniff extends Squiz_FunctionSpacingSniff {
/**
* Processes this test, when one of its tokens is encountered.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token in the stack passed in $tokens.
*
* @return void|int Optionally returns stack pointer to skip to.
*/
Expand Down

0 comments on commit a9f49f3

Please sign in to comment.