src/Call/CallVerifier.php
public function checkIterated(): ?IterableVerifier
    {
        $cardinality = $this->resetCardinality()->assertSingular();

        if ($this->call->responseEvent()) {
            list(, $returnValue) = $this->call->response();

            $isMatch =
                $returnValue instanceof Traversable || is_array($returnValue);
        } else {
            $isMatch = false;
        }

        list($matchCount, $matchingEvents) =
            $this->matchIf($this->call, $isMatch);

        if ($cardinality->matches($matchCount, 1)) {
            return $this->assertionRecorder->createSuccessFromEventCollection(
                $this->iterableVerifierFactory
                    ->create($this->call, $matchingEvents)
            );
        }

        return null;
    }
public function checkIterated(): ?IterableVerifier
    {
        $cardinality = $this->resetCardinality()->assertSingular();

        if ($this->call->responseEvent()) {
            list(, $returnValue) = $this->call->response();

            $isMatch =
                $returnValue instanceof Traversable || is_array($returnValue);
        } else {
            $isMatch = false;
        }

        list($matchCount, $matchingEvents) =
            $this->matchIf($this->call, $isMatch);

        if ($cardinality->matches($matchCount, 1)) {
            return $this->assertionRecorder->createSuccessFromEventCollection(
                $this->iterableVerifierFactory
                    ->create($this->call, $matchingEvents)
            );
        }

        return null;
    }
public function checkIterated ( ) : ? IterableVerifier { $ cardinality = $ this -> resetCardinality ( ) -> assertSingular ( ) ; if ( $ this -> call -> responseEvent ( ) ) { list ( , $ returnValue ) = $ this -> call -> response ( ) ; $ isMatch = $ returnValue instanceof Traversable || is_array ( $ returnValue ) ; } else { $ isMatch = false ; } list ( $ matchCount , $ matchingEvents ) = $ this -> matchIf ( $ this -> call , $ isMatch ) ; if ( $ cardinality -> matches ( $ matchCount , 1 ) ) { return $ this -> assertionRecorder -> createSuccessFromEventCollection ( $ this -> iterableVerifierFactory -> create ( $ this -> call , $ matchingEvents ) ) ; } return null ; }
Checks if this call returned an iterable.

@return IterableVerifier|null       The result.
@throws InvalidCardinalityException If the cardinality is invalid.
Checks if this call returned an iterable .