Inheritance: extends InvalidArgumentException, implements fXmlRpc\Exception\ExceptionInterface
コード例 #1
0
 /** {@inheritdoc} */
 public function addCall($methodName, array $params = [], callable $onSuccess = null, callable $onError = null)
 {
     if (!is_string($methodName)) {
         throw InvalidArgumentException::expectedParameter(1, 'string', $methodName);
     }
     $this->calls[$this->index] = compact('methodName', 'params');
     $this->handlers[$this->index] = compact('onSuccess', 'onError');
     ++$this->index;
     return $this;
 }
コード例 #2
0
 /**
  * @param  callable                 $onError
  * @throws InvalidArgumentException
  * @return self
  */
 public function onError($onError)
 {
     if (!is_callable($onError)) {
         throw InvalidArgumentException::expectedParameter(1, 'callable', $onError);
     }
     $this->onError = $onError;
     return $this;
 }
コード例 #3
0
ファイル: Client.php プロジェクト: Banjerr/infusionWholesaler
 /** {@inheritdoc} */
 public function call($methodName, array $params = [])
 {
     if (!is_string($methodName)) {
         throw InvalidArgumentException::expectedParameter(0, 'string', $methodName);
     }
     $params = array_merge($this->prependParams, $params, $this->appendParams);
     $payload = $this->serializer->serialize($methodName, $params);
     $response = $this->transport->send($this->uri, $payload);
     $result = $this->parser->parse($response, $isFault);
     if ($isFault) {
         throw ResponseException::fault($result);
     }
     return $result;
 }