Eloquent\Phony\Call\CallVerifier::checkReturned PHP Method

checkReturned() public method

When called with no arguments, this method simply checks that the call returned any value.
public checkReturned ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection | null
$value mixed The value.
return Eloquent\Phony\Event\EventCollection | null The result.
    public function checkReturned($value = null)
    {
        $cardinality = $this->resetCardinality()->assertSingular();
        if ($responseEvent = $this->call->responseEvent()) {
            list($exception, $returnValue) = $this->call->response();
            $hasReturned = !$exception;
        } else {
            $returnValue = null;
            $hasReturned = false;
        }
        if (0 === func_num_args()) {
            list($matchCount, $matchingEvents) = $this->matchIf($responseEvent, $hasReturned);
            if ($cardinality->matches($matchCount, 1)) {
                return $this->assertionRecorder->createSuccess($matchingEvents);
            }
            return;
        }
        $value = $this->matcherFactory->adapt($value);
        list($matchCount, $matchingEvents) = $this->matchIf($responseEvent, $hasReturned && $value->matches($returnValue));
        if ($cardinality->matches($matchCount, 1)) {
            return $this->assertionRecorder->createSuccess($matchingEvents);
        }
    }