Esempio n. 1
0
 /**
  * {@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;
 }
Esempio n. 2
0
 /**
  * {@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;
 }