Skip to content

Commit bde4e77

Browse files
committed
updates
1 parent 3d3f6ce commit bde4e77

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/Cloudlinux.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
*
2929
* @access public
3030
*/
31-
class Cloudlinux
32-
{
31+
class Cloudlinux {
3332
private $login = '';
3433
private $key = '';
3534
public $prefix = 'registration.';
@@ -78,7 +77,7 @@ public function __construct($login, $key, $apiType = 'rest') {
7877
*/
7978
public function authToken() {
8079
$time = time();
81-
return $this->login . '|' . $time . '|' . sha1($this->key . $time);
80+
return $this->login.'|'.$time.'|'.sha1($this->key.$time);
8281
}
8382

8483
/**
@@ -169,8 +168,8 @@ public function xmlIsLicensed($ipAddress, $checkAll = true) {
169168
try {
170169
return $this->response = $xmlClient->is_licensed($this->authToken(), $ipAddress, $checkAll);
171170
} catch (\Exception $e) {
172-
$this->log('error', 'Caught exception code: ' . $e->getCode());
173-
$this->log('error', 'Caught exception message: ' . $e->getMessage());
171+
$this->log('error', 'Caught exception code: '.$e->getCode());
172+
$this->log('error', 'Caught exception message: '.$e->getMessage());
174173
return false;
175174
}
176175
}
@@ -229,8 +228,8 @@ public function removeLicense($ipAddress, $type = 0) {
229228
try {
230229
return $this->response = $this->xmlClient->remove_license($this->authToken(), $ipAddress, $type);
231230
} catch (\Exception $e) {
232-
$this->log('error', 'Caught exception code: ' . $e->getCode());
233-
$this->log('error', 'Caught exception message: ' . $e->getMessage());
231+
$this->log('error', 'Caught exception code: '.$e->getCode());
232+
$this->log('error', 'Caught exception message: '.$e->getMessage());
234233
return false;
235234
}
236235
}
@@ -258,7 +257,7 @@ public function removeLicense($ipAddress, $type = 0) {
258257
* @return false|array an array of licenses each one containing these fields: ip(string) ype(int) ­ license type (1,2,16) registered(boolean) ­ true if server was registered in CLN with this license (CLN licenses only). created(string) ­ license creation time
259258
*/
260259
public function restList() {
261-
$this->response = $this->getcurlpage($this->restUrl.'ipl/list.json?token=' . $this->authToken());
260+
$this->response = $this->getcurlpage($this->restUrl.'ipl/list.json?token='.$this->authToken());
262261
return json_decode($this->response, true);
263262
}
264263

@@ -294,14 +293,14 @@ public function licenseList() {
294293
* @return false|integer 0 on success, -1 on error
295294
*/
296295
public function license($ipAddress, $type) {
297-
$type = (int)$type;
296+
$type = (int) $type;
298297
$xmlClient = $this->xmlClient;
299298
try {
300-
$this->log('error', 'Calling License(' . $this->authToken() . ',' . $ipAddress . ',' . $type . ')');
299+
$this->log('error', 'Calling License('.$this->authToken().','.$ipAddress.','.$type.')');
301300
return $this->response = $xmlClient->license($this->authToken(), $ipAddress, $type);
302301
} catch (\Exception $e) {
303-
$this->log('error', 'Caught exception code: ' . $e->getCode());
304-
$this->log('error', 'Caught exception message: ' . $e->getMessage());
302+
$this->log('error', 'Caught exception code: '.$e->getCode());
303+
$this->log('error', 'Caught exception message: '.$e->getMessage());
305304
return false;
306305
}
307306
}

0 commit comments

Comments
 (0)