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

Public Member Functions

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

Public Attributes

 $forbiddenFunctions
 
 $error = true
 

Protected Member Functions

 addError ($phpcsFile, $stackPtr, $function, $pattern=null)
 

Protected Attributes

 $forbiddenFunctionNames = array()
 
 $patternMatch = false
 

Member Function Documentation

PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff::addError (   $phpcsFile,
  $stackPtr,
  $function,
  $pattern = null 
)
protected

Generates the error or warning for this sniff.

Parameters
\PHP_CodeSniffer\Files\File$phpcsFileThe file being scanned.
int$stackPtrThe position of the forbidden function in the token array.
string$functionThe name of the forbidden function.
string$patternThe pattern used for the match.
Returns
void
PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff::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\ForbiddenFunctionsSniff::register ( )

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

Returns
array

Implements PHP_CodeSniffer\Sniffs\Sniff.

Member Data Documentation

PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff::$forbiddenFunctions
Initial value:
= array(
'sizeof' => 'count',
'delete' => 'unset',
)

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