Eloquent\Phony\Call\CallVerifier::checkIterated PHP Метод

checkIterated() публичный Метод

Checks if this call returned an iterable.
public checkIterated ( ) : IterableVerifier | null
Результат Eloquent\Phony\Verification\IterableVerifier | null The result.
    public function checkIterated()
    {
        $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));
        }
    }