@@ -55,7 +55,8 @@ |
||
55 | 55 | */ |
56 | 56 | class E5xx_ActionFailed extends E5xx_ProseException |
57 | 57 | { |
58 | - public function __construct($actionName, $reason = '', $params = array()) { |
|
58 | + public function __construct($actionName, $reason = '', $params = array()) |
|
59 | + { |
|
59 | 60 | $msg = "Action '$actionName' failed"; |
60 | 61 | if (strlen($reason) > 0) { |
61 | 62 | $msg .= "; reason is '{$reason}'"; |
@@ -55,7 +55,8 @@ |
||
55 | 55 | */ |
56 | 56 | class E5xx_ExpectFailed extends E5xx_ProseException |
57 | 57 | { |
58 | - public function __construct($actionName, $expected, $found) { |
|
58 | + public function __construct($actionName, $expected, $found) |
|
59 | + { |
|
59 | 60 | $msg = "Action '$actionName' failed; expected '$expected', found '$found'"; |
60 | 61 | parent::__construct(500, $msg, $msg); |
61 | 62 | } |
@@ -57,7 +57,8 @@ |
||
57 | 57 | */ |
58 | 58 | class E5xx_NotImplemented extends E5xx_ProseException |
59 | 59 | { |
60 | - public function __construct($methodName) { |
|
60 | + public function __construct($methodName) |
|
61 | + { |
|
61 | 62 | $msg = "Method '{$methodName}' has not been implemented yet"; |
62 | 63 | parent::__construct(500, $msg, $msg); |
63 | 64 | } |
@@ -55,7 +55,8 @@ |
||
55 | 55 | */ |
56 | 56 | class E5xx_UnknownDomElementType extends E5xx_ProseException |
57 | 57 | { |
58 | - public function __construct($elementType) { |
|
58 | + public function __construct($elementType) |
|
59 | + { |
|
59 | 60 | $msg = "Unknown DOM element type '{$elementType}'"; |
60 | 61 | parent::__construct(500, $msg, $msg); |
61 | 62 | } |
@@ -121,7 +121,7 @@ |
||
121 | 121 | $log = usingLog()->startAction("$elementDesc '$elementName' must exist"); |
122 | 122 | |
123 | 123 | $actualCount = count($elements); |
124 | - switch($requiredCount) { |
|
124 | + switch ($requiredCount) { |
|
125 | 125 | // this satisfies something like: |
126 | 126 | // |
127 | 127 | // expectsBrowser()->has()->fieldWithId('XX'); |
@@ -216,7 +216,7 @@ |
||
216 | 216 | } |
217 | 217 | |
218 | 218 | // what is the average? |
219 | - $average = $total/$count; |
|
219 | + $average = $total / $count; |
|
220 | 220 | |
221 | 221 | // are we happy? |
222 | 222 | assertsDouble($average)->isLessThanOrEqualTo($expectedAverage); |
@@ -272,7 +272,7 @@ |
||
272 | 272 | $log = usingLog()->startAction("retrieve the value of the $elementDesc '$elementName'"); |
273 | 273 | |
274 | 274 | // is this a select box? |
275 | - switch($element->name()) { |
|
275 | + switch ($element->name()) { |
|
276 | 276 | case 'select': |
277 | 277 | // get the option that is selected |
278 | 278 | try { |
@@ -350,8 +350,7 @@ discard block |
||
350 | 350 | // all done |
351 | 351 | return $credentials; |
352 | 352 | } |
353 | - catch (Exception $e) |
|
354 | - { |
|
353 | + catch (Exception $e) { |
|
355 | 354 | return null; |
356 | 355 | } |
357 | 356 | } |
@@ -370,8 +369,7 @@ discard block |
||
370 | 369 | // get the details |
371 | 370 | return $adapter->hasHttpBasicAuthForHost($hostname); |
372 | 371 | } |
373 | - catch (Exception $e) |
|
374 | - { |
|
372 | + catch (Exception $e) { |
|
375 | 373 | return false; |
376 | 374 | } |
377 | 375 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function get($url, $params = array(), $headers = array()) |
71 | 71 | { |
72 | - if (count($headers)){ |
|
72 | + if (count($headers)) { |
|
73 | 73 | // "FromCurl does not support headers yet" |
74 | 74 | throw new E5xx_NotImplemented(__METHOD__); |
75 | 75 | } |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | // close cURL resource, and free up system resources |
98 | 98 | curl_close($ch); |
99 | 99 | |
100 | - if ($error){ |
|
101 | - throw new E5xx_ActionFailed(__METHOD__.': '.$error); |
|
100 | + if ($error) { |
|
101 | + throw new E5xx_ActionFailed(__METHOD__ . ': ' . $error); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | // Try and decode it |
105 | 105 | $decoded = json_decode($response); |
106 | 106 | |
107 | - if ($decoded){ |
|
107 | + if ($decoded) { |
|
108 | 108 | $response = $decoded; |
109 | 109 | } |
110 | 110 |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function get($url, $params = array(), $headers = array()) |
71 | 71 | { |
72 | - if (count($headers)){ |
|
72 | + if (count($headers)) { |
|
73 | 73 | // "FromCurl does not support headers yet" |
74 | 74 | throw new E5xx_NotImplemented(__METHOD__); |
75 | 75 | } |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | // close cURL resource, and free up system resources |
98 | 98 | curl_close($ch); |
99 | 99 | |
100 | - if ($error){ |
|
100 | + if ($error) { |
|
101 | 101 | throw new E5xx_ActionFailed(__METHOD__.': '.$error); |
102 | 102 | } |
103 | 103 | |
104 | 104 | // Try and decode it |
105 | 105 | $decoded = json_decode($response); |
106 | 106 | |
107 | - if ($decoded){ |
|
107 | + if ($decoded) { |
|
108 | 108 | $response = $decoded; |
109 | 109 | } |
110 | 110 |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @return string Access token |
68 | 68 | */ |
69 | - public function getAccessToken($options = array()){ |
|
69 | + public function getAccessToken($options = array()) { |
|
70 | 70 | |
71 | 71 | // Grab the details of our user |
72 | 72 | $user = $this->args[0]; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $config = $this->st->getRuntimeConfig(); |
79 | 79 | |
80 | 80 | // Check the one in the runtime config if we've not disabled the cache |
81 | - if (isset($config->facebookAccessToken, $config->facebookAccessToken->expires) && $config->facebookAccessToken->expires > time() && !$disableCache){ |
|
81 | + if (isset($config->facebookAccessToken, $config->facebookAccessToken->expires) && $config->facebookAccessToken->expires > time() && !$disableCache) { |
|
82 | 82 | return $config->facebookAccessToken->access_token; |
83 | 83 | } |
84 | 84 |
@@ -66,7 +66,8 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @return string Access token |
68 | 68 | */ |
69 | - public function getAccessToken($options = array()){ |
|
69 | + public function getAccessToken($options = array()) |
|
70 | + { |
|
70 | 71 | |
71 | 72 | // Grab the details of our user |
72 | 73 | $user = $this->args[0]; |
@@ -78,7 +79,7 @@ discard block |
||
78 | 79 | $config = $this->st->getRuntimeConfig(); |
79 | 80 | |
80 | 81 | // Check the one in the runtime config if we've not disabled the cache |
81 | - if (isset($config->facebookAccessToken, $config->facebookAccessToken->expires) && $config->facebookAccessToken->expires > time() && !$disableCache){ |
|
82 | + if (isset($config->facebookAccessToken, $config->facebookAccessToken->expires) && $config->facebookAccessToken->expires > time() && !$disableCache) { |
|
82 | 83 | return $config->facebookAccessToken->access_token; |
83 | 84 | } |
84 | 85 |