src/Stub/StubRule.php
public function next(): Answer
    {
        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];
    }
public function next(): Answer
    {
        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];
    }
public function next ( ) : Answer { 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 ] ; }
Get the next answer.

@return Answer                   The answer.
@throws UndefinedAnswerException If an undefined or incomplete answer is encountered.
Get the next answer .