Eloquent\Phony\Stub\StubRule::next PHP Method

next() public method

Get the next answer.
public next ( ) : Answer
return Eloquent\Phony\Stub\Answer\Answer The answer.
    public function next()
    {
        if ($this->calledCount > $this->lastIndex) {
            $index = $this->lastIndex;
        } else {
            $index = $this->calledCount;
        }
        ++$this->calledCount;
        if (!isset($this->answers[$index]) || !$this->answers[$index]->primaryRequest()) {
            throw new UndefinedAnswerException();
        }
        return $this->answers[$index];
    }