BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff Class Reference
Inheritance diagram for PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff:
Collaboration diagram for PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff:

Public Member Functions

 register ()
 
 process (File $phpcsFile, $stackPtr)
 

Protected Member Functions

 getSnippet ($content, $start='', $length=40)
 
 findClosingTag (File $phpcsFile, $tokens, $stackPtr, $content)
 
 addChangeset (File $phpcsFile, $tokens, $openTagPointer, $closeTagPointer, $echo=false)
 

Member Function Documentation

PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::addChangeset ( File  $phpcsFile,
  $tokens,
  $openTagPointer,
  $closeTagPointer,
  $echo = false 
)
protected

Add a changeset to replace the alternative PHP tags.

Parameters
\PHP_CodeSniffer\Files\File$phpcsFileThe file being scanned.
array$tokensThe token stack.
int$openTagPointerStack pointer to the PHP open tag.
int$closeTagPointerStack pointer to the PHP close tag.
bool$echoWhether to add 'echo' or not.
Returns
void
PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::findClosingTag ( File  $phpcsFile,
  $tokens,
  $stackPtr,
  $content 
)
protected

Try and find a matching PHP closing tag.

Parameters
\PHP_CodeSniffer\Files\File$phpcsFileThe file being scanned.
array$tokensThe token stack.
int$stackPtrThe position of the current token in the stack passed in $tokens.
string$contentThe expected content of the closing tag to match the opener.
Returns
int|false Pointer to the position in the stack for the closing tag or false if not found.
PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::getSnippet (   $content,
  $start = '',
  $length = 40 
)
protected

Get a snippet from a HTML token.

Parameters
string$contentThe content of the HTML token.
string$startPartial string to use as a starting point for the snippet.
int$lengthThe target length of the snippet to get. Defaults to 40.
Returns
string
PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::process ( File  $phpcsFile,
  $stackPtr 
)

Processes this test, when one of its tokens is encountered.

Parameters
\PHP_CodeSniffer\Files\File$phpcsFileThe file being scanned.
int$stackPtrThe position of the current token in the stack passed in $tokens.
Returns
void

Implements PHP_CodeSniffer\Sniffs\Sniff.

PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::register ( )

Returns an array of tokens this test wants to listen for.

Returns
array

Implements PHP_CodeSniffer\Sniffs\Sniff.


The documentation for this class was generated from the following file: