Code Duplication    Length = 5-6 lines in 2 locations

src/BCRM/BackendBundle/Service/Event.php 1 location

@@ 320-325 (lines=6) @@
317
    {
318
        $payment              = $event->payment;
319
        $registrationOptional = $this->registrationRepo->findByUuid($payment->getPayload()->get('item_number'));
320
        if ($registrationOptional->isEmpty()) {
321
            Option::fromValue($this->logger)->map(function (LoggerInterface $logger) use ($payment) {
322
                $logger->alert(sprintf('No registration found with uuid "%s"', $payment->getPayload()->get('item_number')), array($payment));
323
            });
324
            return;
325
        }
326
        $registration = $registrationOptional->get();
327
328
        $command               = new PayRegistrationCommand();

src/BCRM/BackendBundle/Service/Payment.php 1 location

@@ 106-110 (lines=5) @@
103
            Option::fromValue($this->logger)->map(function (LoggerInterface $logger) use ($payment) {
104
                $logger->info(sprintf('Payment "%s" is verified.', $payment->getId()), array($payment));
105
            });
106
        } else {
107
            Option::fromValue($this->logger)->map(function (LoggerInterface $logger) use ($payment) {
108
                $logger->alert(sprintf('Payment "%s" could not be verified.', $payment->getId()), array($payment));
109
            });
110
        }
111
112
        $this->commandBus->handle($updateCommand);
113
    }