Dumplie\CustomerService\Infrastructure\InMemory\InMemoryPayments::getById PHP Method

getById() public method

public getById ( PaymentId $paymentId ) : Payment
$paymentId Dumplie\CustomerService\Domain\PaymentId
return Dumplie\CustomerService\Domain\Payment
    public function getById(PaymentId $paymentId) : Payment
    {
        if (!array_key_exists((string) $paymentId, $this->payments)) {
            throw PaymentNotFoundException::byId($paymentId);
        }
        return $this->payments[(string) $paymentId];
    }