protected function shouldIgnoreUse(File $file, $stackPtr)
    {
        $tokens = $file->getTokens();

        // Ignore USE keywords inside closures.
        $next = $file->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
        if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) {
            return true;
        }

        // Ignore USE keywords for traits.
        if ($file->hasCondition($stackPtr, [T_CLASS, T_TRAIT]) === true) {
            return true;
        }

        return false;
    }
protected function shouldIgnoreUse(File $file, $stackPtr)
    {
        $tokens = $file->getTokens();

        // Ignore USE keywords inside closures.
        $next = $file->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
        if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) {
            return true;
        }

        // Ignore USE keywords for traits.
        if ($file->hasCondition($stackPtr, [T_CLASS, T_TRAIT]) === true) {
            return true;
        }

        return false;
    }
protected function shouldIgnoreUse ( File $ file , $ stackPtr ) { $ tokens = $ file -> getTokens ( ) ; // Ignore USE keywords inside closures. $ next = $ file -> findNext ( T_WHITESPACE , ( $ stackPtr + 1 ) , null , true ) ; if ( $ tokens [ $ next ] [ 'code' ] === T_OPEN_PARENTHESIS ) { return true ; } // Ignore USE keywords for traits. if ( $ file -> hasCondition ( $ stackPtr , [ T_CLASS , T_TRAIT ] ) === true ) { return true ; } return false ; }
Check whether or not a USE statement should be ignored.

@param PHP_CodeSniffer_File $file
@param $stackPtr

@return bool
Check whether or not a USE statement should be ignored .