Skip to content

Commit 886be51

Browse files
resolving merge conflicts
1 parent 4e9666b commit 886be51

2 files changed

Lines changed: 12 additions & 18 deletions

File tree

example.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999

100100
try {
101101
$result = $client->getObject();
102+
//$client->__getLastRequest();
102103
print_r($result);
103104
} catch (\Exception $e) {
104105
die($e->getMessage());

src/SoapClient.php

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,33 +55,29 @@
5555
class SoapClient extends \SoapClient
5656
{
5757
/**
58-
* Your SoftLayer API username. You may overide this value when calling
59-
* getClient().
58+
* Your SoftLayer API username. You may overide this value when calling getClient().
6059
*
6160
* @var string
6261
*/
6362
const API_USER = 'set me';
6463

6564
/**
66-
* Your SoftLayer API user's authentication key. You may overide this value
67-
* when calling getClient().
65+
* Your SoftLayer API user's authentication key. You may overide this value when calling getClient().
6866
*
6967
* @link https://sldn.softlayer.com/article/authenticating-softlayer-api/ API key management in the SoftLayer customer portal
7068
* @var string
7169
*/
7270
const API_KEY = 'set me';
7371

7472
/**
75-
* The base URL of the SoftLayer SOAP API's WSDL files over the public
76-
* Internet.
73+
* The base URL of the SoftLayer SOAP API's WSDL files over the public Internet.
7774
*
7875
* @var string
7976
*/
8077
const API_PUBLIC_ENDPOINT = 'https://api.softlayer.com/soap/v3.1/';
8178

8279
/**
83-
* The base URL of the SoftLayer SOAP API's WSDL files over SoftLayer's
84-
* private network.
80+
* The base URL of the SoftLayer SOAP API's WSDL files over SoftLayer's private network.
8581
*
8682
* @var string
8783
*/
@@ -102,8 +98,7 @@ class SoapClient extends \SoapClient
10298
const API_BASE_URL = SoapClient::API_PUBLIC_ENDPOINT;
10399

104100
/**
105-
* An optional SOAP timeout if you want to set a timeout independent of
106-
* PHP's socket timeout.
101+
* An optional SOAP timeout if you want to set a timeout independent of PHP's socket timeout.
107102
*
108103
* @var int
109104
*/
@@ -182,7 +177,7 @@ public function __call($functionName, $arguments = null)
182177
{
183178
// Determine if we shoud be making an asynchronous call. If so strip
184179
// "Async" from the end of the method name.
185-
if (null === $this->_asyncResult) {
180+
if ($this->_asyncResult === null) {
186181
$this->_asynchronous = false;
187182
$this->_asyncAction = null;
188183

@@ -213,10 +208,9 @@ public function __call($functionName, $arguments = null)
213208
/**
214209
* Create a SoftLayer API SOAP Client.
215210
*
216-
* Retrieve a new SoapClient object for a specific SoftLayer API
217-
* service using either the class' constants API_USER and API_KEY or a
218-
* custom username and API key for authentication. Provide an optional id
219-
* value if you wish to instantiate a particular SoftLayer API object.
211+
* Retrieve a new SoapClient object for a specific SoftLayer API service using either the class'
212+
* constants API_USER and API_KEY or a custom username and API key for authentication.
213+
* Provide an optional id value if you wish to instantiate a particular SoftLayer API object.
220214
*
221215
* @param string $serviceName The name of the SoftLayer API service you wish to query
222216
* @param int $id An optional object id if you're instantiating a particular SoftLayer API object. Setting an id defines this client's initialization parameter header.
@@ -226,8 +220,7 @@ public function __call($functionName, $arguments = null)
226220
* @param bool $trace Enabled SOAP trace in the client object.
227221
* @return SoapClient
228222
*/
229-
public static function getClient($serviceName, $id = null, $username = null, $apiKey = null,
230-
$endpointUrl = null, $trace = false)
223+
public static function getClient($serviceName, $id = null, $username = null, $apiKey = null, $endpointUrl = null, $trace = false)
231224
{
232225
$serviceName = trim($serviceName);
233226

@@ -263,7 +256,7 @@ public static function getClient($serviceName, $id = null, $username = null, $ap
263256
$soapClient->_serviceName = $serviceName;
264257
$soapClient->_endpointUrl = $endpointUrl;
265258

266-
if (empty($username) && empty($apiKey)) {
259+
if (!empty($username) && !empty($apiKey)) {
267260
$soapClient->setAuthentication($username, $apiKey);
268261
} else {
269262
$soapClient->setAuthentication(self::API_USER, self::API_KEY);

0 commit comments

Comments
 (0)