@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | $data = $hostDetails->appSettings->getData($path); |
502 | 502 | |
503 | 503 | // all done |
504 | - $log->endAction([ "setting is", $data ]); |
|
504 | + $log->endAction(["setting is", $data]); |
|
505 | 505 | return $data; |
506 | 506 | } |
507 | 507 | |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | $data = $hostDetails->storySettings->getData($path); |
574 | 574 | |
575 | 575 | // all done |
576 | - $log->endAction([ "setting is", $data ]); |
|
576 | + $log->endAction(["setting is", $data]); |
|
577 | 577 | return $data; |
578 | 578 | } |
579 | 579 |
@@ -57,7 +57,8 @@ |
||
57 | 57 | */ |
58 | 58 | class IframeContext extends PageContext |
59 | 59 | { |
60 | - public function __construct($iframeId) { |
|
60 | + public function __construct($iframeId) |
|
61 | + { |
|
61 | 62 | $this->pageContextAction = function(Story_Context $context) use($iframeId) { |
62 | 63 | $browser = $context->browserSession; |
63 | 64 |
@@ -96,7 +96,7 @@ |
||
96 | 96 | pcntl_alarm($seconds); |
97 | 97 | }); |
98 | 98 | |
99 | - declare(ticks=1); |
|
99 | + declare(ticks = 1); |
|
100 | 100 | $callback = $this->action; |
101 | 101 | $returnVal = $callback($this); |
102 | 102 |
@@ -159,7 +159,7 @@ |
||
159 | 159 | */ |
160 | 160 | public function select($label) |
161 | 161 | { |
162 | - $action = function ($element, $elementName, $elementDesc) use ($label) { |
|
162 | + $action = function($element, $elementName, $elementDesc) use ($label) { |
|
163 | 163 | |
164 | 164 | // what are we doing? |
165 | 165 | $log = usingLog()->startAction("choose option '$label' from $elementDesc '$elementName'"); |
@@ -77,8 +77,7 @@ |
||
77 | 77 | |
78 | 78 | return $return; |
79 | 79 | } |
80 | - catch (Exception $e) |
|
81 | - { |
|
80 | + catch (Exception $e) { |
|
82 | 81 | throw new E5xx_ActionFailed(__METHOD__, $e->getMessage()); |
83 | 82 | } |
84 | 83 | } |
@@ -85,10 +85,10 @@ |
||
85 | 85 | $vmDetails->keyPairName = $awsSettings->ec2->keyPairName; |
86 | 86 | $vmDetails->sshUsername = $awsSettings->ec2->sshUsername; |
87 | 87 | $vmDetails->sshKeyFile = $awsSettings->ec2->sshKeyFile; |
88 | - $vmDetails->sshOptions = array ( |
|
88 | + $vmDetails->sshOptions = array( |
|
89 | 89 | "-i '" . $awsSettings->ec2->sshKeyFile . "'" |
90 | 90 | ); |
91 | - $vmDetails->scpOptions = array ( |
|
91 | + $vmDetails->scpOptions = array( |
|
92 | 92 | "-i '" . $awsSettings->ec2->sshKeyFile . "'" |
93 | 93 | ); |
94 | 94 |
@@ -92,7 +92,7 @@ |
||
92 | 92 | foreach ($this->instance['BlockDeviceMappings'] as $origEbsVolume) { |
93 | 93 | $ebsVolume = array( |
94 | 94 | 'DeviceName' => $origEbsVolume['DeviceName'], |
95 | - 'Ebs' => array ( |
|
95 | + 'Ebs' => array( |
|
96 | 96 | 'DeleteOnTermination' => true |
97 | 97 | ) |
98 | 98 | ); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | { |
72 | 72 | // what are we doing? |
73 | 73 | $log = usingLog()->startAction("get posts from facebook for page {$id} via graph api"); |
74 | - $returnedData = $this->makeGraphApiRequest("/".$id."/posts"); |
|
74 | + $returnedData = $this->makeGraphApiRequest("/" . $id . "/posts"); |
|
75 | 75 | $log->endAction("got posts for page {$id}"); |
76 | 76 | |
77 | 77 | return $returnedData; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @return array First post from a page |
88 | 88 | */ |
89 | - public function getLatestPostFromPage($id){ |
|
89 | + public function getLatestPostFromPage($id) { |
|
90 | 90 | $posts = $this->getPostsFromPage($id); |
91 | 91 | return reset($posts); |
92 | 92 | } |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | $access_token = fromConfig()->getModuleSetting('facebook.access_token'); |
106 | 106 | |
107 | 107 | // GET $path/?access_token=$access_token |
108 | - $resp = fromCurl()->get($this->base_path.$path.'?access_token='. $access_token); |
|
108 | + $resp = fromCurl()->get($this->base_path . $path . '?access_token=' . $access_token); |
|
109 | 109 | |
110 | 110 | // Make sure it's well formed |
111 | 111 | $log = usingLog()->startAction("make sure we have the 'data' key in the response"); |
112 | - if (!isset($resp->data)){ |
|
112 | + if (!isset($resp->data)) { |
|
113 | 113 | |
114 | 114 | // if it was an access token error, remove it from the runtime config |
115 | - if (isset($resp->error->message) && strpos($resp->error->message, "Error validating access token") !== false){ |
|
115 | + if (isset($resp->error->message) && strpos($resp->error->message, "Error validating access token") !== false) { |
|
116 | 116 | // Remove the access token from the runtime config |
117 | 117 | $config = $this->st->getRuntimeConfig(); |
118 | 118 | unset($config->facebookAccessToken); |
@@ -86,7 +86,8 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @return array First post from a page |
88 | 88 | */ |
89 | - public function getLatestPostFromPage($id){ |
|
89 | + public function getLatestPostFromPage($id) |
|
90 | + { |
|
90 | 91 | $posts = $this->getPostsFromPage($id); |
91 | 92 | return reset($posts); |
92 | 93 | } |
@@ -109,10 +110,10 @@ discard block |
||
109 | 110 | |
110 | 111 | // Make sure it's well formed |
111 | 112 | $log = usingLog()->startAction("make sure we have the 'data' key in the response"); |
112 | - if (!isset($resp->data)){ |
|
113 | + if (!isset($resp->data)) { |
|
113 | 114 | |
114 | 115 | // if it was an access token error, remove it from the runtime config |
115 | - if (isset($resp->error->message) && strpos($resp->error->message, "Error validating access token") !== false){ |
|
116 | + if (isset($resp->error->message) && strpos($resp->error->message, "Error validating access token") !== false) { |
|
116 | 117 | // Remove the access token from the runtime config |
117 | 118 | $config = $this->st->getRuntimeConfig(); |
118 | 119 | unset($config->facebookAccessToken); |
@@ -77,7 +77,7 @@ |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | // yes, it really is a form |
80 | - $this->formId = $formId; |
|
80 | + $this->formId = $formId; |
|
81 | 81 | $this->setTopElement($formElement); |
82 | 82 | } |
83 | 83 |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | // what are we doing? |
91 | - $logMsg = [ "HTTP " . strtoupper($verb) . " '${url}'" ]; |
|
91 | + $logMsg = ["HTTP " . strtoupper($verb) . " '${url}'"]; |
|
92 | 92 | if ($body != null) { |
93 | 93 | $logMsg[] = $body; |
94 | 94 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | foreach ($body as $key => $value) { |
113 | 113 | $request->addData($key, $value); |
114 | 114 | } |
115 | - }else{ |
|
115 | + } else { |
|
116 | 116 | $request->setPayload($body); |
117 | 117 | } |
118 | 118 |
@@ -112,7 +112,8 @@ |
||
112 | 112 | foreach ($body as $key => $value) { |
113 | 113 | $request->addData($key, $value); |
114 | 114 | } |
115 | - }else{ |
|
115 | + } |
|
116 | + else { |
|
116 | 117 | $request->setPayload($body); |
117 | 118 | } |
118 | 119 |