Exemplo n.º 1
0
 /**
  * @param string $method_sig
  * @param string $args
  * @param $content
  * @return mixed
  * @throws \PhpAmqpLib\Exception\AMQPRuntimeException
  */
 public function dispatch($method_sig, $args, $content)
 {
     if (!$this->methodMap->valid_method($method_sig)) {
         throw new AMQPRuntimeException(sprintf('Unknown AMQP method "%s"', $method_sig));
     }
     $amqp_method = $this->methodMap->get_method($method_sig);
     if (!method_exists($this, $amqp_method)) {
         throw new AMQPRuntimeException(sprintf('Method: "%s" not implemented by class: %s', $amqp_method, get_class($this)));
     }
     $this->dispatch_reader->reuse($args);
     if ($content == null) {
         return call_user_func(array($this, $amqp_method), $this->dispatch_reader);
     }
     return call_user_func(array($this, $amqp_method), $this->dispatch_reader, $content);
 }
 /**
  * @param string $method_sig
  * @param string $args
  * @param $content
  * @return mixed
  */
 public function dispatch($method_sig, $args, $content)
 {
     if (!$this->methodMap->valid_method($method_sig)) {
         throw new AMQPRuntimeException("Unknown AMQP method {$method_sig}");
     }
     $amqp_method = $this->methodMap->get_method($method_sig);
     if (!method_exists($this, $amqp_method)) {
         throw new AMQPRuntimeException("Method: {$amqp_method} not implemented by class: " . get_class($this));
     }
     $this->dispatch_reader->reuse($args);
     if ($content == null) {
         $result = call_user_func([$this, $amqp_method], $this->dispatch_reader);
         return $result;
     }
     $result = call_user_func([$this, $amqp_method], $this->dispatch_reader, $content);
     return $result;
 }