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


Classes:
Generic_Sniffs_Files_LineLengthSniff
Generic_Sniffs_Formatting_MultipleStatementAlignmentSniff
Generic_Sniffs_Functions_OpeningFunctionBraceBsdAllmanSniff
Generic_Sniffs_Functions_OpeningFunctionBraceKernighanRitchieSniff
Generic_Sniffs_NamingConventions_UpperCaseConstantNameSniff
Generic_Sniffs_PHP_DisallowShortOpenTagSniff
Generic_Sniffs_PHP_ForbiddenFunctionsSniff
Generic_Sniffs_PHP_LowerCaseConstantSniff
Generic_Sniffs_PHP_UpperCaseConstantSniff
Generic_Sniffs_WhiteSpace_ScopeIndentSniff
PEAR_Sniffs_Commenting_ClassCommentSniff
PEAR_Sniffs_Commenting_FileCommentSniff
PEAR_Sniffs_Commenting_FunctionCommentSniff
PEAR_Sniffs_Commenting_InlineCommentSniff
PEAR_Sniffs_ControlStructures_ControlSignatureSniff
PEAR_Sniffs_Files_IncludingFileSniff
PEAR_Sniffs_Files_LineLengthSniff
PEAR_Sniffs_Functions_FunctionCallArgumentSpacingSniff
PEAR_Sniffs_Functions_FunctionCallSignatureSniff
PEAR_Sniffs_Functions_ValidDefaultValueSniff
PEAR_Sniffs_NamingConventions_ValidClassNameSniff
PEAR_Sniffs_NamingConventions_ValidFunctionNameSniff
PEAR_Sniffs_WhiteSpace_ScopeClosingBraceSniff
PEAR_Sniffs_WhiteSpace_ScopeIndentSniff
PHP_CodeSniffer
PHP_CodeSniffer_CommentParser_AbstractDocElement
PHP_CodeSniffer_CommentParser_AbstractParser
PHP_CodeSniffer_CommentParser_ClassCommentParser
PHP_CodeSniffer_CommentParser_CommentElement
PHP_CodeSniffer_CommentParser_FunctionCommentParser
PHP_CodeSniffer_CommentParser_MemberCommentParser
PHP_CodeSniffer_CommentParser_PairElement
PHP_CodeSniffer_CommentParser_ParameterElement
PHP_CodeSniffer_CommentParser_ParserException
PHP_CodeSniffer_CommentParser_SingleElement
PHP_CodeSniffer_Exception
PHP_CodeSniffer_File
PHP_CodeSniffer_Sniff_Exception
PHP_CodeSniffer_Standards_AbstractPatternSniff
PHP_CodeSniffer_Standards_AbstractScopeSniff
PHP_CodeSniffer_Standards_AbstractVariableSniff
PHP_CodeSniffer_Standards_CodingStandard
PHP_CodeSniffer_Standards_Generic_GenericCodingStandard
PHP_CodeSniffer_Standards_IncorrectPatternException
PHP_CodeSniffer_Standards_PEAR_PEARCodingStandard
PHP_CodeSniffer_Standards_Squiz_SquizCodingStandard
PHP_CodeSniffer_Tokens
Squiz_Sniffs_Arrays_ArrayDeclarationSniff
Squiz_Sniffs_Classes_ClassDeclarationSniff
Squiz_Sniffs_Classes_ClassFileNameSniff
Squiz_Sniffs_Classes_SelfMemberReferenceSniff
Squiz_Sniffs_Classes_ValidClassNameSniff
Squiz_Sniffs_Commenting_BlockCommentSniff
Squiz_Sniffs_Commenting_ClassCommentSniff
Squiz_Sniffs_Commenting_ClosingDeclarationCommentSniff
Squiz_Sniffs_Commenting_DocCommentAlignmentSniff
Squiz_Sniffs_Commenting_EmptyCatchCommentSniff
Squiz_Sniffs_Commenting_FileCommentSniff
Squiz_Sniffs_Commenting_FunctionCommentSniff
Squiz_Sniffs_Commenting_FunctionCommentThrowTagSniff
Squiz_Sniffs_Commenting_InlineCommentSniff
Squiz_Sniffs_Commenting_LongConditionClosingCommentSniff
Squiz_Sniffs_Commenting_PostStatementCommentSniff
Squiz_Sniffs_Commenting_VariableCommentSniff
Squiz_Sniffs_ControlStructures_ControlSignatureSniff
Squiz_Sniffs_ControlStructures_ElseIfDeclarationSniff
Squiz_Sniffs_ControlStructures_ForEachLoopDeclarationSniff
Squiz_Sniffs_ControlStructures_ForLoopDeclarationSniff
Squiz_Sniffs_ControlStructures_InlineControlStructureSniff
Squiz_Sniffs_ControlStructures_InlineIfDeclarationSniff
Squiz_Sniffs_ControlStructures_SwitchDeclarationSniff
Squiz_Sniffs_Files_FileExtensionSniff
Squiz_Sniffs_Files_LineLengthSniff
Squiz_Sniffs_Formatting_MultipleStatementAlignmentSniff
Squiz_Sniffs_Formatting_OperatorBracketSniff
Squiz_Sniffs_Formatting_OutputBufferingIndentSniff
Squiz_Sniffs_Functions_FunctionDeclarationArgumentSpacingSniff
Squiz_Sniffs_Functions_FunctionDeclarationSniff
Squiz_Sniffs_Functions_GlobalFunctionSniff
Squiz_Sniffs_NamingConventions_ValidFunctionNameSniff
Squiz_Sniffs_NamingConventions_ValidInterfaceNameSniff
Squiz_Sniffs_NamingConventions_ValidVariableNameSniff
Squiz_Sniffs_Operators_ComparisonOperatorUsageSniff
Squiz_Sniffs_Operators_IncrementDecrementUsageSniff
Squiz_Sniffs_Operators_ValidLogicalOperatorsSniff
Squiz_Sniffs_PHP_DisallowObEndFlushSniff
Squiz_Sniffs_PHP_EmbeddedPhpSniff
Squiz_Sniffs_PHP_ForbiddenFunctionsSniff
Squiz_Sniffs_PHP_GlobalKeywordSniff
Squiz_Sniffs_PHP_HeredocSniff
Squiz_Sniffs_PHP_InnerFunctionsSniff
Squiz_Sniffs_Scope_MemberVarScopeSniff
Squiz_Sniffs_Scope_MethodScopeSniff
Squiz_Sniffs_Scope_StaticThisUsageSniff
Squiz_Sniffs_Strings_ConcatenationSpacingSniff
Squiz_Sniffs_Strings_DoubleQuoteUsageSniff
Squiz_Sniffs_Strings_EchoedStringsSniff
Squiz_Sniffs_WhiteSpace_ControlStructureSpacingSniff
Squiz_Sniffs_WhiteSpace_FunctionClosingBraceSpaceSniff
Squiz_Sniffs_WhiteSpace_FunctionSpacingSniff
Squiz_Sniffs_WhiteSpace_MemberVarSpacingSniff
Squiz_Sniffs_WhiteSpace_OperatorSpacingSniff
Squiz_Sniffs_WhiteSpace_ScopeIndentSniff
Squiz_Sniffs_WhiteSpace_SuperfluousWhitespaceSniff
Files:
AbstractDocElement.php
AbstractParser.php
AbstractPatternSniff.php
AbstractScopeSniff.php
AbstractVariableSniff.php
ArrayDeclarationSniff.php
BlockCommentSniff.php
ClassCommentParser.php
ClassCommentSniff.php
ClassCommentSniff.php
ClassDeclarationSniff.php
ClassFileNameSniff.php
ClosingDeclarationCommentSniff.php
CodeSniffer.php
CodingStandard.php
CommentElement.php
ComparisonOperatorUsageSniff.php
ConcatenationSpacingSniff.php
ControlSignatureSniff.php
ControlSignatureSniff.php
ControlStructureSpacingSniff.php
DisallowObEndFlushSniff.php
DisallowShortOpenTagSniff.php
DocCommentAlignmentSniff.php
DocElement.php
DoubleQuoteUsageSniff.php
EchoedStringsSniff.php
ElseIfDeclarationSniff.php
EmbeddedPhpSniff.php
EmptyCatchCommentSniff.php
Exception.php
File.php
FileCommentSniff.php
FileCommentSniff.php
FileExtensionSniff.php
ForbiddenFunctionsSniff.php
ForbiddenFunctionsSniff.php
ForEachLoopDeclarationSniff.php
ForLoopDeclarationSniff.php
FunctionCallArgumentSpacingSniff.php
FunctionCallSignatureSniff.php
FunctionClosingBraceSpaceSniff.php
FunctionCommentParser.php
FunctionCommentSniff.php
FunctionCommentSniff.php
FunctionCommentThrowTagSniff.php
FunctionDeclarationArgumentSpacingSniff.php
FunctionDeclarationSniff.php
FunctionSpacingSniff.php
GenericCodingStandard.php
GlobalFunctionSniff.php
GlobalKeywordSniff.php
HeredocSniff.php
IncludingFileSniff.php
IncorrectPatternException.php
IncrementDecrementUsageSniff.php
InlineCommentSniff.php
InlineCommentSniff.php
InlineControlStructureSniff.php
InlineIfDeclarationSniff.php
InnerFunctionsSniff.php
LineLengthSniff.php
LineLengthSniff.php
LineLengthSniff.php
LongConditionClosingCommentSniff.php
LowerCaseConstantSniff.php
MemberCommentParser.php
MemberVarScopeSniff.php
MemberVarSpacingSniff.php
MethodScopeSniff.php
MultipleStatementAlignmentSniff.php
MultipleStatementAlignmentSniff.php
OpeningFunctionBraceBsdAllmanSniff.php
OpeningFunctionBraceKernighanRitchieSniff.php
OperatorBracketSniff.php
OperatorSpacingSniff.php
OutputBufferingIndentSniff.php
PairElement.php
ParameterElement.php
ParserException.php
PEARCodingStandard.php
PostStatementCommentSniff.php
ScopeClosingBraceSniff.php
ScopeIndentSniff.php
ScopeIndentSniff.php
ScopeIndentSniff.php
SelfMemberReferenceSniff.php
SingleElement.php
Sniff.php
SniffException.php
SquizCodingStandard.php
StaticThisUsageSniff.php
SuperfluousWhitespaceSniff.php
SwitchDeclarationSniff.php
Tokens.php
UpperCaseConstantNameSniff.php
UpperCaseConstantSniff.php
ValidClassNameSniff.php
ValidClassNameSniff.php
ValidDefaultValueSniff.php
ValidFunctionNameSniff.php
ValidFunctionNameSniff.php
ValidInterfaceNameSniff.php
ValidLogicalOperatorsSniff.php
ValidVariableNameSniff.php
VariableCommentSniff.php

Class: PHP_CodeSniffer_CommentParser_AbstractParser

Source Location: /PHP_CodeSniffer-0.5.0/CodeSniffer/CommentParser/AbstractParser.php


Child classes:

PHP_CodeSniffer_CommentParser_FunctionCommentParser
Parses function doc comments.
PHP_CodeSniffer_CommentParser_ClassCommentParser
Parses Class doc comments.

Inherited Variables

Inherited Methods


Class Details

[line 59]
Parses doc comments.

This abstract parser handles the following tags:

  • The short description and the long description
  • @see
  • @link
  • @deprecated
  • @since

Extending classes should implement the getAllowedTags() method to return the tags that they wish to process, ommiting the tags that this base class processes. When one of these tags in encountered, the process<tag_name> method is called on that class. For example, if a parser's getAllowedTags() method returns \@param as one of its tags, the processParam method will be called so that the parser can process such a tag.

The method is passed the tokens that comprise this tag. The tokens array includes the whitespace that exists between the tokens, as seperate tokens. It's up to the method to create a element that implements the DocElement interface, which should be returned. The AbstractDocElement class is a helper class that can be used to handle most of the parsing of the tokens into their individual sub elements. It requires that you construct it with the element previous to the element currently being processed, which can be acquired with the protected $previousElement class member of this class.



[ Top ]


Class Variables

$comment = null

[line 67]

The comment element that appears in the doc comment.
  • Access: protected



[ Top ]

$deprecated = null

[line 101]

A list of see elements that appear in this doc comment.
  • Access: protected

Type: array(PHP_CodeSniffer_CommentParser_SingleElement)


[ Top ]

$links = array()

[line 108]

A list of see elements that appear in this doc comment.
  • Access: protected

Type: array(PHP_CodeSniffer_CommentParser_SingleElement)


[ Top ]

$orders = array()

[line 148]

The order of tags.
  • Access: public

Type: array(string)


[ Top ]

$previousElement = null

[line 87]

The previous doc element that was processed.

null if the current element being processed is the first element in the doc comment.

  • Access: protected



[ Top ]

$sees = array()

[line 94]

A list of see elements that appear in this doc comment.
  • Access: protected

Type: array(PHP_CodeSniffer_CommentParser_SingleElement)


[ Top ]

$since = null

[line 115]

A element to represent \@since tags.
  • Access: protected



[ Top ]

$unknown = array()

[line 141]

An array of unknown tags.
  • Access: public

Type: array(string)


[ Top ]

$words = array()

[line 77]

The word tokens that appear in the comment.

Whitespace tokens also appear in this stack, but are separate tokens from words.

  • Access: protected

Type: array(string)


[ Top ]



Method Detail

__construct (Constructor) [line 156]

PHP_CodeSniffer_CommentParser_AbstractParser __construct( string $comment)

Constructs a Doc Comment Parser.
  • Access: public

Overridden in child classes as:

PHP_CodeSniffer_CommentParser_FunctionCommentParser::__construct()
Constructs a PHP_CodeSniffer_CommentParser_FunctionCommentParser.

Parameters:

string $comment — The comment to parse.

[ Top ]

getAllowedTags [line 529]

array(string getAllowedTags( )

Returns a list of tags that this comment parser allows for it's comment.

Each tag should indicate if only one entry of this tag can exist in the comment by specifying true as the array value, or false if more than one is allowed. Each tag should ommit the @ symbol. Only tags other than the standard tags should be returned.

  • Return: => boolean)
  • Abstract:
  • Access: protected

Overridden in child classes as:

PHP_CodeSniffer_CommentParser_FunctionCommentParser::getAllowedTags()
Returns the allowed tags that can exist in a function comment.
PHP_CodeSniffer_CommentParser_ClassCommentParser::getAllowedTags()
Returns the allowed tags withing a class comment.
PHP_CodeSniffer_CommentParser_MemberCommentParser::getAllowedTags()
Returns the allowed tags for this parser.

[ Top ]

getComment [line 437]

CommentElement getComment( )

Returns the comment element that appears at the top of this doc comment.
  • Access: public

[ Top ]

getDeprecated [line 465]

SingleElement getDeprecated( )

Returns the deprecated element found in this comment.

Returns null if no element exists in the comment.

  • Access: public

[ Top ]

getLine [line 331]

int getLine( int $tokenPos)

Returns the line that the token exists on in the doc comment.
  • Access: protected

Parameters:

int $tokenPos — The position in the words stack to find the line number for.

[ Top ]

getLinks [line 451]

array(SingleElement) getLinks( )

Returns the link elements found in this comment.

Returns an empty array if no links are found in the comment.

  • Access: public

[ Top ]

getSees [line 425]

array(SingleElement) getSees( )

Returns the see elements that appear in this doc comment.
  • Access: public

[ Top ]

getSince [line 479]

SingleElement getSince( )

Returns the since element found in this comment.

Returns null if no element exists in the comment.

  • Access: public

[ Top ]

getTagOrders [line 537]

array getTagOrders( )

Returns the tag orders (index => tagName).
  • Access: public

[ Top ]

getUnknown [line 549]

array getUnknown( )

Returns the unknown tags.
  • Access: public

[ Top ]

parse [line 170]

void parse( )

Initiates the parsing of the doc comment.
  • Throws: PHP_CodeSniffer_CommentParser_ParserException If the parser finds an anomilty with the comment.
  • Access: public

[ Top ]

parseComment [line 366]

DocElement parseComment( array(string) $tokens)

Parses the comment element that appears at the top of the doc comment.
  • Return: The element that represents this comment element.
  • Access: protected

Parameters:

array(string) $tokens — The word tokens that comprise tihs element.

[ Top ]

parseDeprecated [line 381]

DocElement parseDeprecated( array(string) $tokens)

Parses \@deprecated tags.
  • Return: The element that represents this deprecated tag.
  • Access: protected

Parameters:

array(string) $tokens — The word tokens that comprise tihs element.

[ Top ]

parseLink [line 411]

SingleElement parseLink( array(string) $tokens)

Parses \@link tags.
  • Return: The element that represents this link tag.
  • Access: protected

Parameters:

array(string) $tokens — The word tokens that comprise this element.

[ Top ]

parseSee [line 350]

DocElement parseSee( array(string) $tokens)

Parses see tag element within the doc comment.
  • Return: The element that represents this see comment.
  • Access: protected

Parameters:

array(string) $tokens — The word tokens that comprise this element.

[ Top ]

parseSince [line 396]

SingleElement parseSince( array(string) $tokens)

Parses \@since tags.
  • Return: The element that represents this since tag.
  • Access: protected

Parameters:

array(string) $tokens — The word tokens that comprise this element.

[ Top ]

parseTag [line 499]

void parseTag( string $tag, int $start, int $end)

Parses the specified tag.
  • Throws: Exception If the process method for the tag cannot be found.
  • Access: protected

Parameters:

string $tag — The tag name to parse (omitting the @ sybmol from the tag)
int $start — The position in the word tokens where this element started.
int $end — The position in the word tokens where this element ended.

[ Top ]


Documentation generated on 2019年3月11日 15:00:00 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.

AltStyle によって変換されたページ (->オリジナル) /