PHP Класс Squiz_Sniffs_Classes_SelfMemberReferenceSniff, PHP_CodeSniffer

Verifies that :
  • self:: is used instead of Self::
  • self:: is used for local static member reference
  • self:: is used instead of self ::
Автор: Greg Sherwood ([email protected])
Автор: Marc McIntyre ([email protected])
Наследование: extends PHP_CodeSniffer_Standards_AbstractScopeSniff
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( ) Constructs a Squiz_Sniffs_Classes_SelfMemberReferenceSniff.

Защищенные методы

Метод Описание
getDeclarationNameWithNamespace ( array $tokens, integer $stackPtr ) : string Returns the declaration names for classes/interfaces/functions with a namespace.
getNamespaceOfScope ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : string Returns the namespace declaration of a file.
processTokenWithinScope ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr, integer $currScope ) : void Processes the function tokens within the class.

Описание методов

__construct() публичный Метод

Constructs a Squiz_Sniffs_Classes_SelfMemberReferenceSniff.
public __construct ( )

getDeclarationNameWithNamespace() защищенный Метод

Returns the declaration names for classes/interfaces/functions with a namespace.
protected getDeclarationNameWithNamespace ( array $tokens, integer $stackPtr ) : string
$tokens array Token stack for this file
$stackPtr integer The position where the namespace building will start.
Результат string

getNamespaceOfScope() защищенный Метод

Returns the namespace declaration of a file.
protected getNamespaceOfScope ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : string
$phpcsFile PHP_CodeSniffer_File The file where this token was found.
$stackPtr integer The position where the search for the namespace declaration will start.
Результат string

processTokenWithinScope() защищенный Метод

Processes the function tokens within the class.
protected processTokenWithinScope ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr, integer $currScope ) : void
$phpcsFile PHP_CodeSniffer_File The file where this token was found.
$stackPtr integer The position where the token was found.
$currScope integer The current scope opener token.
Результат void