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


Classes:
PEAR_Sniffs_Commenting_InlineCommentSniff
PEAR_Sniffs_Constants_ValidConstantNameSniff
PEAR_Sniffs_ControlStructures_ControlSignatureSniff
PEAR_Sniffs_Files_IncludingFileSniff
PEAR_Sniffs_Files_LineLengthSniff
PEAR_Sniffs_Methods_FunctionCallSignatureSniff
PEAR_Sniffs_Methods_MethodCallArgumentSpacingSniff
PEAR_Sniffs_Methods_OpeningMethodBraceSniff
PEAR_Sniffs_Methods_ValidDefaultValueSniff
PEAR_Sniffs_Misc_ShortOpenTagSniff
PEAR_Sniffs_NamingConventions_ValidClassNameSniff
PEAR_Sniffs_NamingConventions_ValidFunctionNameSniff
PEAR_Sniffs_PHP_LowerCaseConstantSniff
PEAR_Sniffs_Statements_MultipleStatementSniff
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_IncorrectPatternException
PHP_CodeSniffer_Tokens
Files:
AbstractDocElement.php
AbstractParser.php
AbstractPatternSniff.php
AbstractScopeSniff.php
AbstractVariableSniff.php
ClassCommentParser.php
CodeSniffer.php
CommentElement.php
ControlSignatureSniff.php
DocElement.php
Exception.php
File.php
FunctionCallSignatureSniff.php
FunctionCommentParser.php
IncludingFileSniff.php
IncorrectPatternException.php
InlineCommentSniff.php
LineLengthSniff.php
LowerCaseConstantSniff.php
MemberCommentParser.php
MethodCallArgumentSpacingSniff.php
MultipleStatementSniff.php
OpeningMethodBraceSniff.php
PairElement.php
ParameterElement.php
ParserException.php
ScopeClosingBraceSniff.php
ScopeIndentSniff.php
ShortOpenTagSniff.php
SingleElement.php
Sniff.php
SniffException.php
Tokens.php
ValidClassNameSniff.php
ValidConstantNameSniff.php
ValidDefaultValueSniff.php
ValidFunctionNameSniff.php

Class: PHP_CodeSniffer_CommentParser_AbstractDocElement

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


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 73]
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. }

  • Author: Squiz Pty Ltd
  • Abstract:


[ Top ]


Class Variables

$afterWhitespace = ''

[line 95]

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

Type: string


[ Top ]

$nextElement = null

[line 88]

The element proceeding this element.
  • Access: protected



[ Top ]

$previousElement = null

[line 81]

The element previous to this element.
  • Access: protected



[ Top ]

$tag = ''

[line 109]

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

Type: string


[ Top ]

$tokens = array()

[line 102]

The tokens that comprise this element.
  • Access: protected

Type: array(string)


[ Top ]



Method Detail

__construct (Constructor) [line 120]

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

Constructs a Doc Element.
  • 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.

[ Top ]

getLine [line 273]

int getLine( )

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

[ Top ]

getNextElement [line 193]


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

[ Top ]

getOrder [line 233]

int getOrder( )

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

[ Top ]

getPreviousElement [line 181]


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

[ Top ]

getRawContent [line 261]

string getRawContent( )

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

[ Top ]

getSubElements [line 295]

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 249]

string getTag( )

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

[ Top ]

getWhitespaceAfter [line 221]

string getWhitespaceAfter( )

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

[ Top ]

getWhitespaceBefore [line 205]

string getWhitespaceBefore( )

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

[ Top ]

processSubElement [line 309]

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:50 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.

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