Esempio n. 1
0
 /**
  * {@inheritDoc}
  * @see \Fixin\Delivery\Cargo\CargoHandlerInterface::handle($cargo)
  */
 public function handle(CargoInterface $cargo) : CargoInterface
 {
     if ($cargo instanceof HttpCargoInterface) {
         $method = $cargo->getRequestMethod();
         if (isset(static::METHOD_MAP[$method])) {
             return $this->{static::METHOD_MAP[$method]}($cargo->setStatusCode(Http::STATUS_OK_200));
         }
         return $this->replyMethodNotAllowed($cargo);
     }
     return $cargo;
 }