PHP Class Squiz_Sniffs_Commenting_FunctionCommentSniff, PHP_CodeSniffer

Verifies that :
  • A comment exists
  • There is a blank newline after the short description
  • There is a blank newline between the long and short description
  • There is a blank newline between the long description and tags
  • Parameter names represent those in the method
  • Parameter comments are in the correct order
  • Parameter comments are complete
  • A type hint is provided for array and custom class
  • Type hint matches the actual variable/class type
  • A blank line is present before the first and after the last parameter
  • A return type exists
  • Any throw tag must have a comment
  • The tag order and indentation are correct
Author: Greg Sherwood ([email protected])
Author: Marc McIntyre ([email protected])
Inheritance: implements PHP_CodeSniffer_Sniff
Afficher le fichier Open project: squizlabs/php_codesniffer Class Usage Examples

Méthodes protégées

Méthode Description
processParams ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr, integer $commentStart ) : void Process the function parameter comments.
processReturn ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr, integer $commentStart ) : void Process the return comment of this function comment.
processThrows ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr, integer $commentStart ) : void Process any throw tags that this function comment has.

Method Details

processParams() protected méthode

Process the function parameter comments.
protected processParams ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr, integer $commentStart ) : void
$phpcsFile PHP_CodeSniffer_File The file being scanned.
$stackPtr integer The position of the current token in the stack passed in $tokens.
$commentStart integer The position in the stack where the comment started.
Résultat void

processReturn() protected méthode

Process the return comment of this function comment.
protected processReturn ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr, integer $commentStart ) : void
$phpcsFile PHP_CodeSniffer_File The file being scanned.
$stackPtr integer The position of the current token in the stack passed in $tokens.
$commentStart integer The position in the stack where the comment started.
Résultat void

processThrows() protected méthode

Process any throw tags that this function comment has.
protected processThrows ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr, integer $commentStart ) : void
$phpcsFile PHP_CodeSniffer_File The file being scanned.
$stackPtr integer The position of the current token in the stack passed in $tokens.
$commentStart integer The position in the stack where the comment started.
Résultat void