@@ -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 |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | parent::__construct($st, $args); |
68 | 68 | |
69 | 69 | // $args[0] should be our provisioning block |
70 | - if (!isset($args[0]) || ! $args[0] instanceof ProvisioningDefinition) { |
|
70 | + if (!isset($args[0]) || !$args[0] instanceof ProvisioningDefinition) { |
|
71 | 71 | throw new E5xx_ActionFailed(__METHOD__, "Param #0 must be a ProvisioningDefinition object"); |
72 | 72 | } |
73 | 73 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | }; |
112 | 112 | |
113 | 113 | // build our return object |
114 | - $return = new DelayedProvisioningDefinitionAction ( |
|
114 | + $return = new DelayedProvisioningDefinitionAction( |
|
115 | 115 | $this->args[0], |
116 | 116 | $action |
117 | 117 | ); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | }; |
145 | 145 | |
146 | 146 | // build our return object |
147 | - $return = new DelayedProvisioningDefinitionAction ( |
|
147 | + $return = new DelayedProvisioningDefinitionAction( |
|
148 | 148 | $this->args[0], |
149 | 149 | $action |
150 | 150 | ); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | }; |
174 | 174 | |
175 | 175 | // build our return object |
176 | - $return = new DelayedProvisioningDefinitionAction ( |
|
176 | + $return = new DelayedProvisioningDefinitionAction( |
|
177 | 177 | $this->args[0], |
178 | 178 | $action |
179 | 179 | ); |
@@ -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 | } |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | $tables = $this->getAllTables(); |
75 | 75 | |
76 | 76 | // make sure it exists |
77 | - if (!isset($tables->$tableName)){ |
|
77 | + if (!isset($tables->$tableName)) { |
|
78 | 78 | $log->addStep("{$tableName} does not exist in the runtime config. creating empty table", function() use ($tables, $tableName){ |
79 | 79 | $tables->$tableName = new BaseObject(); |
80 | 80 | }); |
81 | 81 | } |
82 | 82 | |
83 | 83 | // make sure we don't have a duplicate entry |
84 | - if (isset($tables->$tableName->$key)){ |
|
84 | + if (isset($tables->$tableName->$key)) { |
|
85 | 85 | $msg = "Table already contains an entry for '{$key}'"; |
86 | 86 | $log->endAction($msg); |
87 | 87 | throw new E5xx_ActionFailed(__METHOD__, $msg); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $tables = $this->getAllTables(); |
172 | 172 | |
173 | 173 | // make sure it exists |
174 | - if (!isset($tables->$tableName)){ |
|
174 | + if (!isset($tables->$tableName)) { |
|
175 | 175 | $tables->$tableName = new BaseObject(); |
176 | 176 | } |
177 | 177 | if (!isset($tables->$tableName->$group)) { |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | } |
180 | 180 | |
181 | 181 | // make sure we don't have a duplicate entry |
182 | - if (isset($tables->$tableName->$group->$key)){ |
|
182 | + if (isset($tables->$tableName->$group->$key)) { |
|
183 | 183 | $msg = "table already contains an entry for '{$group}->{$key}'"; |
184 | 184 | $log->endAction($msg); |
185 | 185 | throw new E5xx_ActionFailed(__METHOD__, $msg); |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | $tables = $this->getAllTables(); |
75 | 75 | |
76 | 76 | // make sure it exists |
77 | - if (!isset($tables->$tableName)){ |
|
78 | - $log->addStep("{$tableName} does not exist in the runtime config. creating empty table", function() use ($tables, $tableName){ |
|
77 | + if (!isset($tables->$tableName)) { |
|
78 | + $log->addStep("{$tableName} does not exist in the runtime config. creating empty table", function() use ($tables, $tableName) { |
|
79 | 79 | $tables->$tableName = new BaseObject(); |
80 | 80 | }); |
81 | 81 | } |
82 | 82 | |
83 | 83 | // make sure we don't have a duplicate entry |
84 | - if (isset($tables->$tableName->$key)){ |
|
84 | + if (isset($tables->$tableName->$key)) { |
|
85 | 85 | $msg = "Table already contains an entry for '{$key}'"; |
86 | 86 | $log->endAction($msg); |
87 | 87 | throw new E5xx_ActionFailed(__METHOD__, $msg); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | // remove the table if it's empty |
140 | 140 | if (!count(get_object_vars($tables->$tableName))) { |
141 | - $log->addStep("table '{$tableName}' is empty, removing from runtime config", function() use ($tables, $tableName){ |
|
141 | + $log->addStep("table '{$tableName}' is empty, removing from runtime config", function() use ($tables, $tableName) { |
|
142 | 142 | unset($tables->$tableName); |
143 | 143 | }); |
144 | 144 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $tables = $this->getAllTables(); |
172 | 172 | |
173 | 173 | // make sure it exists |
174 | - if (!isset($tables->$tableName)){ |
|
174 | + if (!isset($tables->$tableName)) { |
|
175 | 175 | $tables->$tableName = new BaseObject(); |
176 | 176 | } |
177 | 177 | if (!isset($tables->$tableName->$group)) { |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | } |
180 | 180 | |
181 | 181 | // make sure we don't have a duplicate entry |
182 | - if (isset($tables->$tableName->$group->$key)){ |
|
182 | + if (isset($tables->$tableName->$group->$key)) { |
|
183 | 183 | $msg = "table already contains an entry for '{$group}->{$key}'"; |
184 | 184 | $log->endAction($msg); |
185 | 185 | throw new E5xx_ActionFailed(__METHOD__, $msg); |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | // remove the table if it's empty |
247 | 247 | if (!count(get_object_vars($tables->$tableName->$group))) { |
248 | - $log->addStep("table group '{$tableName}->{$group}' is empty, removing from runtime config", function() use ($tables, $tableName, $group){ |
|
248 | + $log->addStep("table group '{$tableName}->{$group}' is empty, removing from runtime config", function() use ($tables, $tableName, $group) { |
|
249 | 249 | unset($tables->$tableName->$group); |
250 | 250 | }); |
251 | 251 | } |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | |
296 | 296 | // remove the table if it's empty |
297 | 297 | if (!count(get_object_vars($tables->$tableName->$group))) { |
298 | - $log->addStep("table group '{$tableName}->{$group}' is empty, removing from runtime config", function() use ($tables, $tableName, $group){ |
|
298 | + $log->addStep("table group '{$tableName}->{$group}' is empty, removing from runtime config", function() use ($tables, $tableName, $group) { |
|
299 | 299 | unset($tables->$tableName->$group); |
300 | 300 | }); |
301 | 301 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $tables = $this->getAllTables(); |
76 | 76 | |
77 | 77 | // make sure the table |
78 | - if (!isset($tables->$tableName)){ |
|
78 | + if (!isset($tables->$tableName)) { |
|
79 | 79 | $log->addStep("{$tableName} does not exist in the runtime config. creating empty table", function() use ($tables, $tableName){ |
80 | 80 | $tables->$tableName = new BaseObject(); |
81 | 81 | }); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | // make sure we don't have a duplicate entry |
90 | - if (isset($tables->$tableName->$targetEnv->$key)){ |
|
90 | + if (isset($tables->$tableName->$targetEnv->$key)) { |
|
91 | 91 | $msg = "Table already contains an entry for '{$key}'"; |
92 | 92 | $log->endAction($msg); |
93 | 93 | throw new E5xx_ActionFailed(__METHOD__, $msg); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $tables = $this->getAllTables(); |
176 | 176 | |
177 | 177 | // make sure it exists |
178 | - if (!isset($tables->$tableName)){ |
|
178 | + if (!isset($tables->$tableName)) { |
|
179 | 179 | $tables->$tableName = new BaseObject(); |
180 | 180 | } |
181 | 181 | if (!isset($tables->$tableName->$targetEnv)) { |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } |
187 | 187 | |
188 | 188 | // make sure we don't have a duplicate entry |
189 | - if (isset($tables->$tableName->$targetEnv->$group->$key)){ |
|
189 | + if (isset($tables->$tableName->$targetEnv->$group->$key)) { |
|
190 | 190 | $msg = "table already contains an entry for '{$group}->{$key}'"; |
191 | 191 | $log->endAction($msg); |
192 | 192 | throw new E5xx_ActionFailed(__METHOD__, $msg); |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | $tables = $this->getAllTables(); |
76 | 76 | |
77 | 77 | // make sure the table |
78 | - if (!isset($tables->$tableName)){ |
|
79 | - $log->addStep("{$tableName} does not exist in the runtime config. creating empty table", function() use ($tables, $tableName){ |
|
78 | + if (!isset($tables->$tableName)) { |
|
79 | + $log->addStep("{$tableName} does not exist in the runtime config. creating empty table", function() use ($tables, $tableName) { |
|
80 | 80 | $tables->$tableName = new BaseObject(); |
81 | 81 | }); |
82 | 82 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | // make sure we don't have a duplicate entry |
90 | - if (isset($tables->$tableName->$targetEnv->$key)){ |
|
90 | + if (isset($tables->$tableName->$targetEnv->$key)) { |
|
91 | 91 | $msg = "Table already contains an entry for '{$key}'"; |
92 | 92 | $log->endAction($msg); |
93 | 93 | throw new E5xx_ActionFailed(__METHOD__, $msg); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $tables = $this->getAllTables(); |
176 | 176 | |
177 | 177 | // make sure it exists |
178 | - if (!isset($tables->$tableName)){ |
|
178 | + if (!isset($tables->$tableName)) { |
|
179 | 179 | $tables->$tableName = new BaseObject(); |
180 | 180 | } |
181 | 181 | if (!isset($tables->$tableName->$targetEnv)) { |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } |
187 | 187 | |
188 | 188 | // make sure we don't have a duplicate entry |
189 | - if (isset($tables->$tableName->$targetEnv->$group->$key)){ |
|
189 | + if (isset($tables->$tableName->$targetEnv->$group->$key)) { |
|
190 | 190 | $msg = "table already contains an entry for '{$group}->{$key}'"; |
191 | 191 | $log->endAction($msg); |
192 | 192 | throw new E5xx_ActionFailed(__METHOD__, $msg); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | |
310 | 310 | // remove the table if it's empty |
311 | 311 | if (!count(get_object_vars($tables->$tableName->$targetEnv->$groupName))) { |
312 | - $log->addStep("table group '{$tableName}->{$targetEnv}->{$groupName}' is empty, removing from runtime config", function() use ($tables, $tableName, $targetEnv, $groupName){ |
|
312 | + $log->addStep("table group '{$tableName}->{$targetEnv}->{$groupName}' is empty, removing from runtime config", function() use ($tables, $tableName, $targetEnv, $groupName) { |
|
313 | 313 | unset($tables->$tableName->$targetEnv->$groupName); |
314 | 314 | }); |
315 | 315 | } |