@@ -24,7 +24,7 @@ |
||
24 | 24 | * @param Throwable|null $previous |
25 | 25 | * @param int $unionCloudCode |
26 | 26 | */ |
27 | - public function __construct($message = "", $code = 0, Throwable $previous = null, $unionCloudCode=0) |
|
27 | + public function __construct($message = "", $code = 0, Throwable $previous = null, $unionCloudCode = 0) |
|
28 | 28 | { |
29 | 29 | parent::__construct($message, $code, $previous, $unionCloudCode); |
30 | 30 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | * @param Throwable|null $previous |
24 | 24 | * @param int $unionCloudCode |
25 | 25 | */ |
26 | - public function __construct($message = "", $code = 0, Throwable $previous = null, $unionCloudCode=0) |
|
26 | + public function __construct($message = "", $code = 0, Throwable $previous = null, $unionCloudCode = 0) |
|
27 | 27 | { |
28 | 28 | parent::__construct($message, $code, $previous, $unionCloudCode); |
29 | 29 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * @param Throwable|null $previous |
26 | 26 | * @param int $unionCloudCode |
27 | 27 | */ |
28 | - public function __construct($message = "", $code = 0, Throwable $previous = null, $unionCloudCode=0) |
|
28 | + public function __construct($message = "", $code = 0, Throwable $previous = null, $unionCloudCode = 0) |
|
29 | 29 | { |
30 | 30 | parent::__construct($message, $code, $previous, $unionCloudCode); |
31 | 31 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * @param Throwable|null $previous |
26 | 26 | * @param int $unionCloudCode |
27 | 27 | */ |
28 | - public function __construct($message = "", $code = 0, Throwable $previous = null, $unionCloudCode=0) |
|
28 | + public function __construct($message = "", $code = 0, Throwable $previous = null, $unionCloudCode = 0) |
|
29 | 29 | { |
30 | 30 | parent::__construct($message, $code, $previous, $unionCloudCode); |
31 | 31 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | public function authArrayKeysExist($keys, $parameters) |
30 | 30 | { |
31 | 31 | foreach ($keys as $key) { |
32 | - if(!array_key_exists($key, $parameters)){ |
|
32 | + if (!array_key_exists($key, $parameters)) { |
|
33 | 33 | return false; |
34 | 34 | } |
35 | 35 | } |
@@ -44,21 +44,21 @@ discard block |
||
44 | 44 | * @throws AuthenticationParameterMissing |
45 | 45 | * @throws AuthenticatorNotFound |
46 | 46 | */ |
47 | - public function __construct($authParams = null, $authenticator=null) |
|
47 | + public function __construct($authParams = null, $authenticator = null) |
|
48 | 48 | { |
49 | - if(is_array($authParams)) |
|
49 | + if (is_array($authParams)) |
|
50 | 50 | { |
51 | 51 | // Find the authenticator class |
52 | - if($authenticator === null) { |
|
52 | + if ($authenticator === null) { |
|
53 | 53 | $this->authenticator = new v0Authenticator(); |
54 | - } elseif($authenticator instanceof IAuthenticator) { |
|
54 | + } elseif ($authenticator instanceof IAuthenticator) { |
|
55 | 55 | $this->authenticator = $authenticator; |
56 | 56 | } else { |
57 | 57 | throw new AuthenticatorNotFound(); |
58 | 58 | } |
59 | 59 | |
60 | 60 | // Validate and set the parameters |
61 | - if( ! $this->authenticator->validateParameters($authParams) ) |
|
61 | + if (!$this->authenticator->validateParameters($authParams)) |
|
62 | 62 | { |
63 | 63 | throw new AuthenticationParameterMissing(); |
64 | 64 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function setAuthenticator($authenticator) |
79 | 79 | { |
80 | - if($authenticator instanceof IAuthenticator) |
|
80 | + if ($authenticator instanceof IAuthenticator) |
|
81 | 81 | { |
82 | 82 | $this->authenticator = $authenticator; |
83 | 83 | return; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function addAuthentication($options, $configuration) |
99 | 99 | { |
100 | - if($this->authenticator->needsRefresh()) |
|
100 | + if ($this->authenticator->needsRefresh()) |
|
101 | 101 | { |
102 | 102 | $this->authenticator->authenticate($configuration->getBaseURL()); |
103 | 103 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function hasAuthentication() |
113 | 113 | { |
114 | - if ( ! $this->authenticator instanceof IAuthenticator) |
|
114 | + if (!$this->authenticator instanceof IAuthenticator) |
|
115 | 115 | { |
116 | 116 | return false; |
117 | 117 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | "Accept-Version" => "v1", |
273 | 273 | ], |
274 | 274 | 'http_errors' => true, |
275 | - 'verify' => __DIR__ . '/../../unioncloud.pem', |
|
275 | + 'verify' => __DIR__.'/../../unioncloud.pem', |
|
276 | 276 | 'debug' => false |
277 | 277 | ]; |
278 | 278 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | { |
298 | 298 | |
299 | 299 | $response = $e->getResponse(); |
300 | - if($response === null) |
|
300 | + if ($response === null) |
|
301 | 301 | { |
302 | 302 | throw new BaseUnionCloudException('No response received from UnionCloud', 500, $e); |
303 | 303 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | |
307 | 307 | |
308 | 308 | // If there's a body, we may be able to process the error messages |
309 | - if(strlen($body) > 0) |
|
309 | + if (strlen($body) > 0) |
|
310 | 310 | { |
311 | 311 | // Get the message body |
312 | 312 | try { |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | |
330 | 330 | $unionCloudErrorCodes = $this->getAuthFailureCodes(); |
331 | 331 | |
332 | - if(array_key_exists($errorCode, $unionCloudErrorCodes)) |
|
332 | + if (array_key_exists($errorCode, $unionCloudErrorCodes)) |
|
333 | 333 | { |
334 | 334 | $throwable = $unionCloudErrorCodes[$errorCode]['throwable']; |
335 | 335 | throw new $throwable($unionCloudErrorCodes[$errorCode]['message'], $code, $e, $errorCode); |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | * |
21 | 21 | * e.g 'bristol.unioncloud.org' |
22 | 22 | * |
23 | - * @var string $baseURL |
|
24 | - */ |
|
23 | + * @var string $baseURL |
|
24 | + */ |
|
25 | 25 | private $baseURL; |
26 | 26 | |
27 | 27 | /** |
@@ -35,40 +35,40 @@ discard block |
||
35 | 35 | |
36 | 36 | |
37 | 37 | /** |
38 | - * Get the property baseURL |
|
39 | - * |
|
40 | - * @return string |
|
41 | - */ |
|
38 | + * Get the property baseURL |
|
39 | + * |
|
40 | + * @return string |
|
41 | + */ |
|
42 | 42 | public function getBaseURL() |
43 | 43 | { |
44 | 44 | return $this->baseURL; |
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
48 | - * Set the property baseURL |
|
49 | - * |
|
50 | - * @param string $baseURL |
|
51 | - */ |
|
48 | + * Set the property baseURL |
|
49 | + * |
|
50 | + * @param string $baseURL |
|
51 | + */ |
|
52 | 52 | public function setBaseURL($baseURL) |
53 | 53 | { |
54 | 54 | $this->baseURL = 'https://'.$baseURL; |
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | - * Get the property debug |
|
59 | - * |
|
60 | - * @return string |
|
61 | - */ |
|
58 | + * Get the property debug |
|
59 | + * |
|
60 | + * @return string |
|
61 | + */ |
|
62 | 62 | public function getDebug() |
63 | 63 | { |
64 | 64 | return $this->debug; |
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
68 | - * Set the property debug |
|
69 | - * |
|
70 | - * @param string $debug |
|
71 | - */ |
|
68 | + * Set the property debug |
|
69 | + * |
|
70 | + * @param string $debug |
|
71 | + */ |
|
72 | 72 | public function setDebug($debug) |
73 | 73 | { |
74 | 74 | $this->debug = $debug; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @throws AuthenticatorNotFound |
51 | 51 | * @throws Exception\Authentication\AuthenticationParameterMissing |
52 | 52 | */ |
53 | - public function __construct($authParams = null, $authenticator=null) |
|
53 | + public function __construct($authParams = null, $authenticator = null) |
|
54 | 54 | { |
55 | 55 | $this->authentication = new Authentication($authParams, $authenticator); |
56 | 56 | $this->configuration = new Configuration(); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | private function checkReadyForRequest() |
79 | 79 | { |
80 | - if(! $this->authentication->hasAuthentication()) |
|
80 | + if (!$this->authentication->hasAuthentication()) |
|
81 | 81 | { |
82 | 82 | throw new AuthenticatorNotFound(); |
83 | 83 | } |