/** * @param $reservationId * @return Response */ public function deleteReservationsAction($reservationId) { try { $this->library->giveBackBookFromReservation(Uuid::fromString($reservationId)); } catch (CannotGiveBackReservationWhichWasNotGivenAway $e) { return new JsonResponse(null, Response::HTTP_BAD_REQUEST); } return new Response(null, Response::HTTP_NO_CONTENT); }
/** * @When /^I give back a book from reservation "([^"]*)"$/ */ public function iGiveBackABookFromReservation($reservationId) { $this->execute(function () use($reservationId) { $this->library->giveBackBookFromReservation(Uuid::fromString($reservationId)); }); }