private function getAllTokens(File $phpcsFile, array $tokens, $start, $end): array
    {
        $found = [];

        $pointer = $start + 1;
        while (false !== $pointer && $pointer < $end) {
            $tokenPtr = $phpcsFile->findNext([T_VARIABLE], $pointer, $end - 1);

            // If no more tokens are found, return
            if (!\is_int($tokenPtr)) {
                return $found;
            }

            // Capture token
            $found[$tokens[$tokenPtr]['code']] = $tokenPtr;

            // Move pointer to next token
            $pointer = $tokenPtr + 1;
        }

        return $found;
    }