コード例 #1
0
 /**
  * @param Service  $api           Service API description
  * @param string   $endpoint      Endpoint to connect to
  * @param JsonBody $jsonFormatter Optional JSON formatter to use
  */
 public function __construct(Service $api, $endpoint, JsonBody $jsonFormatter = null)
 {
     parent::__construct($api, $endpoint);
     $this->contentType = JsonBody::getContentType($api);
     $this->jsonFormatter = $jsonFormatter ?: new JsonBody($api);
 }
コード例 #2
0
 /**
  * @param Service $api      Service API description
  * @param string  $endpoint Endpoint to connect to
  * @param XmlBody $xmlBody  Optional XML formatter to use
  */
 public function __construct(Service $api, $endpoint, XmlBody $xmlBody = null)
 {
     parent::__construct($api, $endpoint);
     $this->xmlBody = $xmlBody ?: new XmlBody($api);
 }