PHP Class CakePHP_Sniffs_Commenting_FunctionCommentSniff

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 return type exists
  • There must be one blank line between body and headline comments.
  • Any throw tag must have an exception class.
Author: Greg Sherwood ([email protected])
Author: Marc McIntyre ([email protected])
Inheritance: implements PHP_CodeSniffer_Sniff
Mostrar archivo Open project: cakephp/cakephp-codesniffer

Protected Methods

Method Description
isInheritDoc ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : boolean Is the comment an inheritdoc?
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

isInheritDoc() protected method

Is the comment an inheritdoc?
protected isInheritDoc ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : boolean
$phpcsFile PHP_CodeSniffer_File The file being scanned.
$stackPtr integer The position of the current token in the stack passed in $tokens.
return boolean True if the comment is an inheritdoc

processParams() protected method

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.
return void

processReturn() protected method

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.
return void

processThrows() protected method

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.
return void