Eloquent\Phony\Verification\IterableVerifier::checkUsed PHP Method

checkUsed() public method

Checks if iteration of the subject commenced.
public checkUsed ( ) : Eloquent\Phony\Event\EventCollection | null
return Eloquent\Phony\Event\EventCollection | null The result.
    public function checkUsed()
    {
        $cardinality = $this->resetCardinality();
        if ($this->subject instanceof Call) {
            $cardinality->assertSingular();
        }
        $matchingEvents = array();
        $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);
        }
    }