Created
June 28, 2019 19:53
-
-
Save wuestkamp/7c52caf3707624680e4cf5b698fd489b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types=1); | |
... | |
class CreateBookingMessageHandler implements MessageHandlerInterface | |
{ | |
private $bookingManager; | |
public function __construct(BookingManager $bookingManager) | |
{ | |
$this->bookingManager = $bookingManager; | |
} | |
public function __invoke(CreateBookingMessage $bookingMessage) | |
{ | |
$booking = $this->bookingManager->findBooking($bookingMessage->getBookingId()); | |
if ($booking instanceof Booking && $booking->getStatus() === Booking::STATUS_NEW) { | |
$this->bookingManager->processBooking($booking); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment