@@ -109,7 +109,7 @@ |
||
| 109 | 109 | { |
| 110 | 110 | global $help; |
| 111 | 111 | |
| 112 | - echo("Usage: php ". basename(__FILE__) . " -c configFile [-h] [-k <key>] [-s <secret>] [-r <region>]\n"); |
|
| 112 | + echo("Usage: php " . basename(__FILE__) . " -c configFile [-h] [-k <key>] [-s <secret>] [-r <region>]\n"); |
|
| 113 | 113 | echo("-h: Print this help\n"); |
| 114 | 114 | echo("-d: Debug mode\n"); |
| 115 | 115 | echo("-c: configFile\n"); |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | $this->cpeLogger->log_out( |
| 108 | 108 | "ERROR", |
| 109 | 109 | basename(__FILE__), |
| 110 | - $e->getMessage().print_r($msg, true)); |
|
| 110 | + $e->getMessage() . print_r($msg, true)); |
|
| 111 | 111 | } catch (\Exception $e) { |
| 112 | 112 | $this->cpeLogger->log_out( |
| 113 | 113 | "ERROR", |
| 114 | 114 | basename(__FILE__), |
| 115 | - $e->getMessage().print_r($msg, true)); |
|
| 115 | + $e->getMessage() . print_r($msg, true)); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | // Message polled. Valid or not, we delete it from SQS |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $this->cpeLogger->log_out( |
| 141 | 141 | "INFO", |
| 142 | 142 | basename(__FILE__), |
| 143 | - "Received message '" . $message->{"type"} . "'" |
|
| 143 | + "Received message '" . $message->{"type"} . "'" |
|
| 144 | 144 | ); |
| 145 | 145 | if ($this->debug) |
| 146 | 146 | $this->cpeLogger->log_out( |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $this->cpeLogger->log_out( |
| 190 | 190 | "INFO", |
| 191 | 191 | basename(__FILE__), |
| 192 | - "New workflow submitted to SWF: ".$workflowRunId->get('runId')); |
|
| 192 | + "New workflow submitted to SWF: " . $workflowRunId->get('runId')); |
|
| 193 | 193 | |
| 194 | 194 | // Send WORKFLOW_SCHEDULED message back to client |
| 195 | 195 | $this->cpeSqsWriter->workflow_scheduled($workflowType, $workflowRunId->get('runId'), $workflowId, $message); |
@@ -215,10 +215,10 @@ discard block |
||
| 215 | 215 | private function validate_message($message) |
| 216 | 216 | { |
| 217 | 217 | if (!isset($message) || |
| 218 | - !isset($message->{"time"}) || $message->{"time"} == "" || |
|
| 219 | - !isset($message->{"jobId"}) || $message->{"jobId"} == "" || |
|
| 220 | - !isset($message->{"type"}) || $message->{"type"} == "" || |
|
| 221 | - !isset($message->{"data"}) || $message->{"data"} == "") |
|
| 218 | + !isset($message->{"time"}) || $message->{"time"} == "" || |
|
| 219 | + !isset($message->{"jobId"}) || $message->{"jobId"} == "" || |
|
| 220 | + !isset($message->{"type"}) || $message->{"type"} == "" || |
|
| 221 | + !isset($message->{"data"}) || $message->{"data"} == "") |
|
| 222 | 222 | throw new CpeSdk\CpeException("'time', 'type', 'jobId' or 'data' fields missing in JSON message file!", |
| 223 | 223 | self::INVALID_JSON); |
| 224 | 224 | |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | function usage($defaultConfigFile) |
| 240 | 240 | { |
| 241 | - echo("Usage: php ". basename(__FILE__) . " [-h] [-d] [-n <client_name>] [-l <log path>] -c <config_file path>\n"); |
|
| 241 | + echo("Usage: php " . basename(__FILE__) . " [-h] [-d] [-n <client_name>] [-l <log path>] -c <config_file path>\n"); |
|
| 242 | 242 | echo("-h: Print this help\n"); |
| 243 | 243 | echo("-d: Debug mode\n"); |
| 244 | 244 | echo("-l <log_path>: Location where logs will be dumped in (folder).\n"); |
@@ -289,9 +289,9 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | if (isset($options['n'])) |
| 291 | 291 | { |
| 292 | - $config->clients = [(object)[ |
|
| 292 | + $config->clients = [(object) [ |
|
| 293 | 293 | 'name' => $options['n'], |
| 294 | - 'queues' => (object)[ |
|
| 294 | + 'queues' => (object) [ |
|
| 295 | 295 | 'input' => getenv('INPUT_QUEUE'), |
| 296 | 296 | 'output' => getenv('OUTPUT_QUEUE'), |
| 297 | 297 | ], |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | // Poll from all the taskList registered for each activities |
| 91 | 91 | if ($this->debug) |
| 92 | 92 | $this->cpeLogger->log_out("DEBUG", basename(__FILE__), |
| 93 | - "Polling activity taskList '" . $this->taskList . "' ... "); |
|
| 93 | + "Polling activity taskList '" . $this->taskList . "' ... "); |
|
| 94 | 94 | |
| 95 | 95 | try { |
| 96 | 96 | // Call SWF and poll for incoming tasks |
@@ -191,9 +191,9 @@ discard block |
||
| 191 | 191 | if (!file_exists($activityToHandle->{"file"})) |
| 192 | 192 | { |
| 193 | 193 | $this->cpeLogger->log_out("ERROR", basename(__FILE__), |
| 194 | - "The code file '".$activityToHandle->{"file"}."' for activity: name=" |
|
| 194 | + "The code file '" . $activityToHandle->{"file"} . "' for activity: name=" |
|
| 195 | 195 | . $activityToHandle->{"name"} . ",version=" |
| 196 | - . $activityToHandle->{"version"}." doesn't exists! Check if the file is accessible and if the path is correct in your config file."); |
|
| 196 | + . $activityToHandle->{"version"} . " doesn't exists! Check if the file is accessible and if the path is correct in your config file."); |
|
| 197 | 197 | return false; |
| 198 | 198 | } |
| 199 | 199 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | $this->cpeLogger->log_out("ERROR", basename(__FILE__), |
| 228 | 228 | "No Activity handler was found for: name=" |
| 229 | 229 | . $this->activityName . ",version=" |
| 230 | - . $this->activityVersion.". Check your config file and ensure your 'activity' name AND 'version' is there."); |
|
| 230 | + . $this->activityVersion . ". Check your config file and ensure your 'activity' name AND 'version' is there."); |
|
| 231 | 231 | return false; |
| 232 | 232 | } |
| 233 | 233 | } |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | // Usage |
| 246 | 246 | function usage($defaultConfigFile) |
| 247 | 247 | { |
| 248 | - echo("Usage: php ". basename(__FILE__) . " -D <domain> -T <task_list> -A <activity_name> -V <activity_version> [-h] [-d] [-c <config_file path>] [-l <log path>]\n"); |
|
| 248 | + echo("Usage: php " . basename(__FILE__) . " -D <domain> -T <task_list> -A <activity_name> -V <activity_version> [-h] [-d] [-c <config_file path>] [-l <log path>]\n"); |
|
| 249 | 249 | echo("-h: Print this help\n"); |
| 250 | 250 | echo("-d: Debug mode\n"); |
| 251 | 251 | echo("-c <config_file path>: Optional parameter to override the default configuration file: '$defaultConfigFile'.\n"); |