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;
    }