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

Class: PHP_CodeSniffer_CommentParser_SingleElement

Source Location: /PHP_CodeSniffer-0.7.0/CodeSniffer/CommentParser/SingleElement.php

Class Overview

PHP_CodeSniffer_CommentParser_AbstractDocElement
   |
   --PHP_CodeSniffer_CommentParser_SingleElement

A class to represent single element doc tags.


Author(s):

Version:

  • Release: 0.7.0

Copyright:

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

Variables

Methods


Child classes:

PHP_CodeSniffer_CommentParser_CommentElement
A class to represent Comments of a doc comment.

Inherited Variables

Inherited Methods

Class: PHP_CodeSniffer_CommentParser_AbstractDocElement

PHP_CodeSniffer_CommentParser_AbstractDocElement::__construct()
Constructs a Doc Element.
PHP_CodeSniffer_CommentParser_AbstractDocElement::getLine()
Returns the line in which this element first occured.
PHP_CodeSniffer_CommentParser_AbstractDocElement::getNextElement()
Returns the element that exists after this.
PHP_CodeSniffer_CommentParser_AbstractDocElement::getOrder()
Returns the order that this element appears in the comment.
PHP_CodeSniffer_CommentParser_AbstractDocElement::getPreviousElement()
Returns the element that exists before this.
PHP_CodeSniffer_CommentParser_AbstractDocElement::getRawContent()
Returns the raw content of this element, ommiting the tag.
PHP_CodeSniffer_CommentParser_AbstractDocElement::getSubElements()
Returns the sub element names that make up this element in the order they appear in the element.
PHP_CodeSniffer_CommentParser_AbstractDocElement::getTag()
Returns the tag that this element represents, ommiting the @ symbol.
PHP_CodeSniffer_CommentParser_AbstractDocElement::getWhitespaceAfter()
Returns the whitespace that exists after this element.
PHP_CodeSniffer_CommentParser_AbstractDocElement::getWhitespaceBefore()
Returns the whitespace that exists before this element.
PHP_CodeSniffer_CommentParser_AbstractDocElement::processSubElement()
Called to process each sub element as sepcified in the return value of getSubElements().

Class Details

[line 34]
A class to represent single element doc tags.

A single element doc tag contains only one value after the tag itself. An example would be the \@package tag.



[ Top ]


Class Variables

$content =  ''

[line 43]

The content that exists after the tag.

Type:   string


[ Top ]

$contentWhitespace =  ''

[line 51]

The whitespace that exists before the content.

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 62]

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

Constructs a SingleElement doc tag.
  • Access: public

Overridden in child classes as:

PHP_CodeSniffer_CommentParser_CommentElement::__construct()
Constructs a PHP_CodeSniffer_CommentParser_CommentElement.

Overrides PHP_CodeSniffer_CommentParser_AbstractDocElement::__construct() (Constructs a Doc Element.)

Parameters:

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

[ Top ]

getContent   [line 109]

string getContent( )

Returns the content of this tag.
  • Access: public

[ Top ]

getSubElements   [line 76]

array(string) getSubElements( )

Returns the element names that this tag is comprised of, in the order that they appear in the tag.

Overrides PHP_CodeSniffer_CommentParser_AbstractDocElement::getSubElements() (Returns the sub element names that make up this element in the order they appear in the element.)
[ Top ]

getWhitespaceBeforeContent   [line 121]

string getWhitespaceBeforeContent( )

Returns the witespace before the content of this tag.
  • Access: public

[ Top ]

process   [line 137]

void process( PHP_CodeSniffer_File $phpcsFile, int $commentStart, string $docBlock)

Processes a content check for single doc element.
  • Access: public

Parameters:

PHP_CodeSniffer_File   $phpcsFile   —  The file being scanned.
int   $commentStart   —  The line number where the error occurs.
string   $docBlock   —  Whether this is a file or class comment doc

[ Top ]

processSubElement   [line 96]

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

Processes the sub element with the specified name.

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

Parameters:

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

[ Top ]


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