src/Verification/IterableVerifier.php
public function checkConsumed(): ?EventCollection
    {
        $cardinality = $this->resetCardinality();

        if ($this->subject instanceof Call) {
            $cardinality->assertSingular();
        }

        $matchingEvents = [];
        $matchCount = 0;

        foreach ($this->calls as $call) {
            if (!$endEvent = $call->endEvent()) {
                continue;
            }
            if (!$call->isIterable()) {
                continue;
            }

            ++$matchCount;
            $matchingEvents[] = $endEvent;
        }

        if ($cardinality->matches($matchCount, $this->callCount)) {
            return $this->assertionRecorder->createSuccess($matchingEvents);
        }

        return null;
    }
public function checkConsumed(): ?EventCollection
    {
        $cardinality = $this->resetCardinality();

        if ($this->subject instanceof Call) {
            $cardinality->assertSingular();
        }

        $matchingEvents = [];
        $matchCount = 0;

        foreach ($this->calls as $call) {
            if (!$endEvent = $call->endEvent()) {
                continue;
            }
            if (!$call->isIterable()) {
                continue;
            }

            ++$matchCount;
            $matchingEvents[] = $endEvent;
        }

        if ($cardinality->matches($matchCount, $this->callCount)) {
            return $this->assertionRecorder->createSuccess($matchingEvents);
        }

        return null;
    }
public function checkConsumed ( ) : ? EventCollection { $ cardinality = $ this -> resetCardinality ( ) ; if ( $ this -> subject instanceof Call ) { $ cardinality -> assertSingular ( ) ; } $ matchingEvents = [ ] ; $ matchCount = 0 ; foreach ( $ this -> calls as $ call ) { if ( ! $ endEvent = $ call -> endEvent ( ) ) { continue ; } if ( ! $ call -> isIterable ( ) ) { continue ; } ++ $ matchCount ; $ matchingEvents [ ] = $ endEvent ; } if ( $ cardinality -> matches ( $ matchCount , $ this -> callCount ) ) { return $ this -> assertionRecorder -> createSuccess ( $ matchingEvents ) ; } return null ; }
Checks if the subject was completely consumed.

@return EventCollection|null The result.
Checks if the subject was completely consumed .