src/Spy/SpyVerifier.php
public function checkCompleted(): ?EventCollection
    {
        $cardinality = $this->resetCardinality();

        $calls = $this->spy->allCalls();
        $matchingEvents = [];
        $totalCount = count($calls);
        $matchCount = 0;

        foreach ($calls as $call) {
            if ($endEvent = $call->endEvent()) {
                $matchingEvents[] = $endEvent;
                ++$matchCount;
            }
        }

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

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

        $calls = $this->spy->allCalls();
        $matchingEvents = [];
        $totalCount = count($calls);
        $matchCount = 0;

        foreach ($calls as $call) {
            if ($endEvent = $call->endEvent()) {
                $matchingEvents[] = $endEvent;
                ++$matchCount;
            }
        }

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

        return null;
    }
public function checkCompleted ( ) : ? EventCollection { $ cardinality = $ this -> resetCardinality ( ) ; $ calls = $ this -> spy -> allCalls ( ) ; $ matchingEvents = [ ] ; $ totalCount = count ( $ calls ) ; $ matchCount = 0 ; foreach ( $ calls as $ call ) { if ( $ endEvent = $ call -> endEvent ( ) ) { $ matchingEvents [ ] = $ endEvent ; ++ $ matchCount ; } } if ( $ cardinality -> matches ( $ matchCount , $ totalCount ) ) { return $ this -> assertionRecorder -> createSuccess ( $ matchingEvents ) ; } return null ; }
Checks if this spy completed.

@return EventCollection|null The result.
Checks if this spy completed .