PhpCss\Parser::handleMismatch PHP Method

handleMismatch() private method

Handle the case if none of the expected tokens could be found.
private handleMismatch ( array() $expectedTokens, integer $position ) : Exception
$expectedTokens array()
$position integer
return Exception
    private function handleMismatch($expectedTokens, $position = 0)
    {
        // If the token stream ended unexpectedly throw an appropriate exception
        if (!isset($this->_tokens[$position])) {
            return new Exception\UnexpectedEndOfFile($expectedTokens);
        }
        // We found a token but none of the expected ones.
        return new Exception\TokenMismatch($this->_tokens[$position], $expectedTokens);
    }