PHP_CodeSniffer
[ class tree: PHP_CodeSniffer ] [ index: PHP_CodeSniffer ] [ all elements ]

Class: PEAR_Sniffs_Commenting_FunctionCommentSniff

Source Location: /PHP_CodeSniffer-0.7.0/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php

Class Overview


Parses and verifies the doc comments for functions.


Author(s):

Version:

  • Release: 0.7.0

Copyright:

  • 2006 Squiz Pty Ltd (ABN 77 084 670 600)

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 47]
Parses and verifies the doc comments for functions.

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 space is present before the first and after the last parameter
  • A return type exists
  • If a body comment exists, it must be one blank newline from the headline comment.
  • Any throw tag must have a comment.



[ Top ]


Class Variables

$commentParser =  null

[line 76]

The function comment parser for the current method.
  • Access: protected

Type:   PHP_CodeSniffer_Comment_Parser_FunctionCommentParser


[ Top ]

$currentFile =  null

[line 83]

The current PHP_CodeSniffer_File object we are processing.
  • Access: protected



[ Top ]



Method Detail

process   [line 107]

void process( PHP_CodeSniffer_File $phpcsFile, int $stackPtr)

Processes this test, when one of its tokens is encountered.
  • Access: public

Parameters:

PHP_CodeSniffer_File   $phpcsFile   —  The file being scanned.
int   $stackPtr   —  The position of the current token in the stack passed in $tokens.

[ Top ]

processParams   [line 292]

void processParams( int $commentStart)

Process the function parameter comments.
  • Access: protected

Parameters:

int   $commentStart   —  The position in the stack where the comment started.

[ Top ]

processReturn   [line 257]

void processReturn( int $commentStart, int $commentEnd)

Process the return comment of this function comment.
  • Access: protected

Parameters:

int   $commentStart   —  The position in the stack where the comment started.
int   $commentEnd   —  The position in the stack where the comment ended.

[ Top ]

processThrows   [line 229]

void processThrows( int $commentStart)

Process any throw tags that this function comment has.
  • Access: protected

Parameters:

int   $commentStart   —  The position in the stack where the comment started.

[ Top ]

register   [line 91]

array register( )

Returns an array of tokens this test wants to listen for.
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:06:34 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.