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


Classes:
Generic_Sniffs_Files_LineEndingsSniff
Generic_Sniffs_Files_LineLengthSniff
Generic_Sniffs_Formatting_MultipleStatementAlignmentSniff
Generic_Sniffs_Formatting_NoSpaceAfterCastSniff
Generic_Sniffs_Formatting_SpaceAfterCastSniff
Generic_Sniffs_Functions_OpeningFunctionBraceBsdAllmanSniff
Generic_Sniffs_Functions_OpeningFunctionBraceKernighanRitchieSniff
Generic_Sniffs_Metrics_CyclomaticComplexitySniff
Generic_Sniffs_Metrics_NestingLevelSniff
Generic_Sniffs_NamingConventions_UpperCaseConstantNameSniff
Generic_Sniffs_PHP_DisallowShortOpenTagSniff
Generic_Sniffs_PHP_ForbiddenFunctionsSniff
Generic_Sniffs_PHP_LowerCaseConstantSniff
Generic_Sniffs_PHP_UpperCaseConstantSniff
Generic_Sniffs_WhiteSpace_DisallowTabIndentSniff
Generic_Sniffs_WhiteSpace_ScopeIndentSniff
PEAR_Sniffs_Classes_ClassDeclarationSniff
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_LineEndingsSniff
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_DocGenerators_Generator
PHP_CodeSniffer_DocGenerators_HTML
PHP_CodeSniffer_DocGenerators_Text
PHP_CodeSniffer_Exception
PHP_CodeSniffer_File
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_PHPCS_PHPCSCodingStandard
PHP_CodeSniffer_Standards_Squiz_SquizCodingStandard
PHP_CodeSniffer_Tokens
Squiz_Sniffs_Arrays_ArrayDeclarationSniff
Squiz_Sniffs_Classes_ClassDeclarationSniff
Squiz_Sniffs_Classes_ClassFileNameSniff
Squiz_Sniffs_Classes_LowercaseClassKeywordsSniff
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_LowercaseDeclarationSniff
Squiz_Sniffs_ControlStructures_SwitchDeclarationSniff
Squiz_Sniffs_Files_FileExtensionSniff
Squiz_Sniffs_Files_LineEndingsSniff
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_Functions_LowercaseFunctionKeywordsSniff
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_EvalSniff
Squiz_Sniffs_PHP_ForbiddenFunctionsSniff
Squiz_Sniffs_PHP_GlobalKeywordSniff
Squiz_Sniffs_PHP_HeredocSniff
Squiz_Sniffs_PHP_InnerFunctionsSniff
Squiz_Sniffs_PHP_LowercasePHPFunctionsSniff
Squiz_Sniffs_PHP_NonExecutableCodeSniff
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_CastSpacingSniff
Squiz_Sniffs_WhiteSpace_ControlStructureSpacingSniff
Squiz_Sniffs_WhiteSpace_FunctionClosingBraceSpaceSniff
Squiz_Sniffs_WhiteSpace_FunctionSpacingSniff
Squiz_Sniffs_WhiteSpace_MemberVarSpacingSniff
Squiz_Sniffs_WhiteSpace_OperatorSpacingSniff
Squiz_Sniffs_WhiteSpace_ScopeClosingBraceSniff
Squiz_Sniffs_WhiteSpace_ScopeIndentSniff
Squiz_Sniffs_WhiteSpace_SuperfluousWhitespaceSniff
Files:
AbstractDocElement.php
AbstractParser.php
AbstractPatternSniff.php
AbstractScopeSniff.php
AbstractVariableSniff.php
ArrayDeclarationSniff.php
BlockCommentSniff.php
CastSpacingSniff.php
ClassCommentParser.php
ClassCommentSniff.php
ClassCommentSniff.php
ClassDeclarationSniff.php
ClassDeclarationSniff.php
ClassFileNameSniff.php
ClosingDeclarationCommentSniff.php
CodeSniffer.php
CodingStandard.php
CommentElement.php
ComparisonOperatorUsageSniff.php
ConcatenationSpacingSniff.php
ControlSignatureSniff.php
ControlSignatureSniff.php
ControlStructureSpacingSniff.php
CyclomaticComplexitySniff.php
DisallowObEndFlushSniff.php
DisallowShortOpenTagSniff.php
DisallowTabIndentSniff.php
DocCommentAlignmentSniff.php
DocElement.php
DoubleQuoteUsageSniff.php
EchoedStringsSniff.php
ElseIfDeclarationSniff.php
EmbeddedPhpSniff.php
EmptyCatchCommentSniff.php
EvalSniff.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
Generator.php
GenericCodingStandard.php
GlobalFunctionSniff.php
GlobalKeywordSniff.php
HeredocSniff.php
HTML.php
IncludingFileSniff.php
IncorrectPatternException.php
IncrementDecrementUsageSniff.php
InlineCommentSniff.php
InlineCommentSniff.php
InlineControlStructureSniff.php
InlineIfDeclarationSniff.php
InnerFunctionsSniff.php
LineEndingsSniff.php
LineEndingsSniff.php
LineEndingsSniff.php
LineLengthSniff.php
LineLengthSniff.php
LineLengthSniff.php
LongConditionClosingCommentSniff.php
LowercaseClassKeywordsSniff.php
LowerCaseConstantSniff.php
LowercaseDeclarationSniff.php
LowercaseFunctionKeywordsSniff.php
LowercasePHPFunctionsSniff.php
MemberCommentParser.php
MemberVarScopeSniff.php
MemberVarSpacingSniff.php
MethodScopeSniff.php
MultipleStatementAlignmentSniff.php
MultipleStatementAlignmentSniff.php
NestingLevelSniff.php
NonExecutableCodeSniff.php
NoSpaceAfterCastSniff.php
OpeningFunctionBraceBsdAllmanSniff.php
OpeningFunctionBraceKernighanRitchieSniff.php
OperatorBracketSniff.php
OperatorSpacingSniff.php
OutputBufferingIndentSniff.php
PairElement.php
ParameterElement.php
ParserException.php
PEARCodingStandard.php
PHPCSCodingStandard.php
PostStatementCommentSniff.php
ScopeClosingBraceSniff.php
ScopeClosingBraceSniff.php
ScopeIndentSniff.php
ScopeIndentSniff.php
ScopeIndentSniff.php
SelfMemberReferenceSniff.php
SingleElement.php
Sniff.php
SpaceAfterCastSniff.php
SquizCodingStandard.php
StaticThisUsageSniff.php
SuperfluousWhitespaceSniff.php
SwitchDeclarationSniff.php
Text.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_AbstractDocElement

Source Location: /PHP_CodeSniffer-0.8.0/CodeSniffer/CommentParser/AbstractDocElement.php

Class Overview


A class to handle most of the parsing operations of a doc comment element.


Author(s):

Version:

  • Release: 0.8.0

Copyright:

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

Variables

Methods


Child classes:

PHP_CodeSniffer_CommentParser_PairElement
A class to represent elements that have a value => comment format.
PHP_CodeSniffer_CommentParser_ParameterElement
A class to represent param tags within a function comment.
PHP_CodeSniffer_CommentParser_SingleElement
A class to represent single element doc tags.

Inherited Variables

Inherited Methods


Class Details

[line 64]
A class to handle most of the parsing operations of a doc comment element.

Extending classes should implement the getSubElements method to return a list of elements that the doc comment element contains, in the order that they appear in the element. For example a function parameter element has a type, a variable name and a comment. It should therefore implement the method as follows:

  1. protected function getSubElements ()
  2. {
  3. return array(
  4. 'type',
  5. 'variable',
  6. 'comment',
  7. );
  8. }

The processSubElement will be called for each of the sub elements to allow the extending class to process them. So for the parameter element we would have:

  1. protected function processSubElement ($name, $content, $whitespaceBefore)
  2. {
  3. if ($name === 'type') {
  4. echo 'The name of the variable was '.$content;
  5. }
  6. // Process other tags.
  7. }



[ Top ]


Class Variables

$afterWhitespace = ''

[line 86]

The whitespace the occurs after this element and its sub elements.
  • Access: protected

Type: string


[ Top ]

$nextElement = null

[line 79]

The element proceeding this element.
  • Access: protected



[ Top ]

$phpcsFile = null

[line 100]

The file this element is in.
  • Access: protected

Type: array(string)


[ Top ]

$previousElement = null

[line 72]

The element previous to this element.
  • Access: protected



[ Top ]

$tag = ''

[line 107]

The tag that this element represents (omiting the @ symbol).
  • Access: protected

Type: string


[ Top ]

$tokens = array()

[line 93]

The tokens that comprise this element.
  • Access: protected

Type: array(string)


[ Top ]



Method Detail

__construct (Constructor) [line 122]

PHP_CodeSniffer_CommentParser_AbstractDocElement __construct( PHP_CodeSniffer_CommentParser_DocElement $previousElement, array $tokens, string $tag, PHP_CodeSniffer_File $phpcsFile)

Constructs a Doc Element.
  • Throws: Exception If $previousElement in not a DocElement or if getSubElements() does not return an array.
  • Access: public

Overridden in child classes as:

PHP_CodeSniffer_CommentParser_PairElement::__construct()
Constructs a PHP_CodeSniffer_CommentParser_PairElement doc tag.
PHP_CodeSniffer_CommentParser_ParameterElement::__construct()
Constructs a PHP_CodeSniffer_CommentParser_ParameterElement.
PHP_CodeSniffer_CommentParser_SingleElement::__construct()
Constructs a SingleElement doc tag.
PHP_CodeSniffer_CommentParser_CommentElement::__construct()
Constructs a PHP_CodeSniffer_CommentParser_CommentElement.

Parameters:

PHP_CodeSniffer_CommentParser_DocElement $previousElement — The element that ocurred before this.
array $tokens — The tokens of this element.
string $tag — The doc element tag this element represents.
PHP_CodeSniffer_File $phpcsFile — The file that this element is in.

[ Top ]

getLine [line 277]

int getLine( )

Returns the line in which this element first occured.
  • Access: public

[ Top ]

getNextElement [line 197]


Returns the element that exists after this.
  • Access: public

[ Top ]

getOrder [line 237]

int getOrder( )

Returns the order that this element appears in the comment.
  • Access: public

[ Top ]

getPreviousElement [line 185]


Returns the element that exists before this.
  • Access: public

[ Top ]

getRawContent [line 265]

string getRawContent( )

Returns the raw content of this element, ommiting the tag.
  • Access: public

[ Top ]

getSubElements [line 299]

array(string) getSubElements( )

Returns the sub element names that make up this element in the order they appear in the element.

Overridden in child classes as:

PHP_CodeSniffer_CommentParser_PairElement::getSubElements()
Returns the element names that this tag is comprised of, in the order that they appear in the tag.
PHP_CodeSniffer_CommentParser_ParameterElement::getSubElements()
Returns the element names that this tag is comprised of, in the order that they appear in the tag.
PHP_CodeSniffer_CommentParser_SingleElement::getSubElements()
Returns the element names that this tag is comprised of, in the order that they appear in the tag.

[ Top ]

getTag [line 253]

string getTag( )

Returns the tag that this element represents, ommiting the @ symbol.
  • Access: public

[ Top ]

getWhitespaceAfter [line 225]

string getWhitespaceAfter( )

Returns the whitespace that exists after this element.
  • Access: public

[ Top ]

getWhitespaceBefore [line 209]

string getWhitespaceBefore( )

Returns the whitespace that exists before this element.
  • Access: public

[ Top ]

processSubElement [line 313]

void processSubElement( string $name, string $content, string $whitespaceBefore)

Called to process each sub element as sepcified in the return value of getSubElements().

Overridden in child classes as:

PHP_CodeSniffer_CommentParser_PairElement::processSubElement()
Processes the sub element with the specified name.
PHP_CodeSniffer_CommentParser_ParameterElement::processSubElement()
Processes the sub element with the specified name.
PHP_CodeSniffer_CommentParser_SingleElement::processSubElement()
Processes the sub element with the specified name.

Parameters:

string $name — The name of the element to process.
string $content — The content of the the element.
string $whitespaceBefore — The whitespace found before this element.

[ Top ]


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

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