Changeset View
Changeset View
Standalone View
Standalone View
src/conduit/ConduitClient.php
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | public function callMethod($method, array $params) { | ||||
if ($this->oauthToken) { | if ($this->oauthToken) { | ||||
$meta['access_token'] = $this->oauthToken; | $meta['access_token'] = $this->oauthToken; | ||||
} | } | ||||
if ($meta) { | if ($meta) { | ||||
$params['__conduit__'] = $meta; | $params['__conduit__'] = $meta; | ||||
} | } | ||||
$uri = id(clone $this->uri)->setPath('/api/'.$method); | $uri = (clone $this->uri)->setPath('/api/'.$method); | ||||
Lint: PHP Syntax Error!: This file contains a syntax error: XHPAST Parse Error: syntax error, unexpected… | |||||
$data = array( | $data = array( | ||||
'params' => json_encode($params), | 'params' => json_encode($params), | ||||
'output' => 'json', | 'output' => 'json', | ||||
// This is a hint to Phabricator that the client expects a Conduit | // This is a hint to Phabricator that the client expects a Conduit | ||||
// response. It is not necessary, but provides better error messages in | // response. It is not necessary, but provides better error messages in | ||||
// some cases. | // some cases. | ||||
Show All 25 Lines | public function callMethod($method, array $params) { | ||||
} | } | ||||
if ($this->username !== null) { | if ($this->username !== null) { | ||||
$core_future->setHTTPBasicAuthCredentials( | $core_future->setHTTPBasicAuthCredentials( | ||||
$this->username, | $this->username, | ||||
$this->password); | $this->password); | ||||
} | } | ||||
return id(new ConduitFuture($core_future)) | return (new ConduitFuture($core_future)) | ||||
->setClient($this, $method); | ->setClient($this, $method); | ||||
} | } | ||||
public function setBasicAuthCredentials($username, $password) { | public function setBasicAuthCredentials($username, $password) { | ||||
$this->username = $username; | $this->username = $username; | ||||
$this->password = new PhutilOpaqueEnvelope($password); | $this->password = new PhutilOpaqueEnvelope($password); | ||||
return $this; | return $this; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 229 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
This file contains a syntax error: XHPAST Parse Error: syntax error, unexpected T_OBJECT_OPERATOR on line 138