public function inClassScope(File $phpcsFile, $stackPtr, $strict = true)
    {
        $validScopes = array(\T_CLASS);
        if (\defined('T_ANON_CLASS') === true) {
            $validScopes[] = \T_ANON_CLASS;
        }

        if ($strict === false) {
            $validScopes[] = \T_INTERFACE;
            $validScopes[] = \T_TRAIT;
        }

        return $phpcsFile->hasCondition($stackPtr, $validScopes);
    }
public function inClassScope(File $phpcsFile, $stackPtr, $strict = true)
    {
        $validScopes = array(\T_CLASS);
        if (\defined('T_ANON_CLASS') === true) {
            $validScopes[] = \T_ANON_CLASS;
        }

        if ($strict === false) {
            $validScopes[] = \T_INTERFACE;
            $validScopes[] = \T_TRAIT;
        }

        return $phpcsFile->hasCondition($stackPtr, $validScopes);
    }
public function inClassScope ( File $ phpcsFile , $ stackPtr , $ strict = true ) { $ validScopes = array ( \ T_CLASS ) ; if ( \ defined ( 'T_ANON_CLASS' ) === true ) { $ validScopes [ ] = \ T_ANON_CLASS ; } if ( $ strict === false ) { $ validScopes [ ] = \ T_INTERFACE ; $ validScopes [ ] = \ T_TRAIT ; } return $ phpcsFile -> hasCondition ( $ stackPtr , $ validScopes ) ; }
Verify whether a token is within a class scope.

@param \PHP_CodeSniffer_File $phpcsFile The file being scanned.
@param int                   $stackPtr  The position of the token.
@param bool                  $strict    Whether to strictly check for the T_CLASS
scope or also accept interfaces and traits
as scope.

@return bool True if within class scope, false otherwise.
Verify whether a token is within a class scope .