/** * {@inheritDoc} * @see \Fixin\Delivery\Cargo\CargoHandlerInterface::handle($cargo) */ public function handle(CargoInterface $cargo) : CargoInterface { if ($cargo instanceof HttpCargoInterface && $cargo->getStatusCode() === Http::STATUS_CONTINUE_100) { return $this->handleHttpCargo($cargo); } return $cargo; }
/** * {@inheritDoc} * @see \Fixin\Delivery\Cargo\CargoHandlerInterface::handle($cargo) */ public function handle(CargoInterface $cargo) : CargoInterface { if ($cargo instanceof HttpCargoInterface) { $statusCode = $cargo->getStatusCode(); if ($statusCode >= Http::STATUS_BAD_REQUEST_400 && $statusCode <= Http::STATUS_LAST_POSSIBLE_ERROR) { return $this->getRoute()->handle($cargo)->setDelivered(true); } } return $cargo; }