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

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

        $matchingEvents = [];
        $matchCount = 0;

        foreach ($this->calls as $call) {
            foreach ($call->iterableEvents() as $event) {
                if ($event instanceof UsedEvent) {
                    $matchingEvents[] = $event;
                    ++$matchCount;
                }
            }
        }

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

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

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

        $matchingEvents = [];
        $matchCount = 0;

        foreach ($this->calls as $call) {
            foreach ($call->iterableEvents() as $event) {
                if ($event instanceof UsedEvent) {
                    $matchingEvents[] = $event;
                    ++$matchCount;
                }
            }
        }

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

        return null;
    }
public function checkUsed ( ) : ? EventCollection { $ cardinality = $ this -> resetCardinality ( ) ; if ( $ this -> subject instanceof Call ) { $ cardinality -> assertSingular ( ) ; } $ matchingEvents = [ ] ; $ matchCount = 0 ; foreach ( $ this -> calls as $ call ) { foreach ( $ call -> iterableEvents ( ) as $ event ) { if ( $ event instanceof UsedEvent ) { $ matchingEvents [ ] = $ event ; ++ $ matchCount ; } } } if ( $ cardinality -> matches ( $ matchCount , $ this -> callCount ) ) { return $ this -> assertionRecorder -> createSuccess ( $ matchingEvents ) ; } return null ; }
Checks if iteration of the subject commenced.

@return EventCollection|null The result.
Checks if iteration of the subject commenced .