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

Class: SelfMemberReferenceSniff

Source Location: /PHP_CodeSniffer-3.1.1/src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php

Class Overview

AbstractScopeSniff
   |
   --SelfMemberReferenceSniff

Tests self member references.


Author(s):

Copyright:

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

Methods


Inherited Variables

Inherited Methods

Class: AbstractScopeSniff

AbstractScopeSniff::__construct()
Constructs a new AbstractScopeTest.
AbstractScopeSniff::process()
Processes the tokens that this test is listening for.
AbstractScopeSniff::processTokenOutsideScope()
Processes a token that is found outside the scope that this test is listening to.
AbstractScopeSniff::processTokenWithinScope()
Processes a token that is found within the scope that this test is listening to.
AbstractScopeSniff::register()
The method that is called to register the tokens this test wishes to listen to.

Class Details

[line 20]
Tests self member references.

Verifies that :

  • self:: is used instead of Self::
  • self:: is used for local static member reference
  • self:: is used instead of self ::



[ Top ]


Method Detail

__construct (Constructor)   [line 27]

SelfMemberReferenceSniff __construct( )

Constructs a Squiz_Sniffs_Classes_SelfMemberReferenceSniff.
  • Access: public

Overrides AbstractScopeSniff::__construct() (Constructs a new AbstractScopeTest.)
[ Top ]

getDeclarationNameWithNamespace   [line 150]

string getDeclarationNameWithNamespace( array $tokens, int $stackPtr)

Returns the declaration names for classes/interfaces/functions with a namespace.
  • Access: protected

Parameters:

array   $tokens   —  Token stack for this file
int   $stackPtr   —  The position where the namespace building will start.

[ Top ]

getNamespaceOfScope   [line 176]

string getNamespaceOfScope( File $phpcsFile, int $stackPtr)

Returns the namespace declaration of a file.
  • Access: protected

Parameters:

\PHP_CodeSniffer\Files\File   $phpcsFile   —  The file where this token was found.
int   $stackPtr   —  The position where the search for the namespace declaration will start.

[ Top ]

processTokenOutsideScope   [line 136]

void processTokenOutsideScope( File $phpcsFile, int $stackPtr)

Processes a token that is found within the scope that this test is listening to.
  • Access: protected

Overrides AbstractScopeSniff::processTokenOutsideScope() (Processes a token that is found outside the scope that this test is listening to.)

Parameters:

\PHP_CodeSniffer\Files\File   $phpcsFile   —  The file where this token was found.
int   $stackPtr   —  The position in the stack where this token was found.

[ Top ]

processTokenWithinScope   [line 43]

void processTokenWithinScope( File $phpcsFile, int $stackPtr, int $currScope)

Processes the function tokens within the class.
  • Access: protected

Overrides AbstractScopeSniff::processTokenWithinScope() (Processes a token that is found within the scope that this test is listening to.)

Parameters:

\PHP_CodeSniffer\Files\File   $phpcsFile   —  The file where this token was found.
int   $stackPtr   —  The position where the token was found.
int   $currScope   —  The current scope opener token.

[ Top ]


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