Skip to content

Commit

Permalink
style: fix remaining trailing comma phpcs issues
Browse files Browse the repository at this point in the history
There's a bug in phpcs that is preventing these checks from catching all cases. With this in mind, I've opted to use the Drupal standards to catch these missing cases which seems to work well. The rule is "Drupal.Arrays.Array.CommaLastItem"
  • Loading branch information
keevan committed Jul 11, 2022
1 parent bdc5b65 commit 709527d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion classes/dataflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public function get_variables(): array {
'DATAFLOW_RUN_NAME' => $this->engine->run->name ?? null,
],
'dataflow' => $dataflow,
'steps' => $steps
'steps' => $steps,
];
return $variables;
}
Expand Down
2 changes: 1 addition & 1 deletion classes/local/step/connector_s3.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function execute(): bool {
$config = $this->enginestep->stepdef->config;
$connectionoptions = [
'version' => 'latest',
'region' => $config->region
'region' => $config->region,
];
if ($config->key !== '') {
$connectionoptions['credentials'] = [
Expand Down
11 changes: 6 additions & 5 deletions classes/step.php
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,12 @@ protected function validate_link_count(int $count, string $inputoutput, string $
$steptype = $this->steptype;
[$min, $max] = $steptype->$fn();
if ($count < $min || $count > $max) {
return ["invalid_count_{$inputoutput}{$flowconnector}s_{$this->id}" => get_string(
"stepinvalid{$inputoutput}{$flowconnector}count",
'tool_dataflows',
$count
) . ' ' . visualiser::get_link_expectations($steptype, $inputoutput)
return [
"invalid_count_{$inputoutput}{$flowconnector}s_{$this->id}" => get_string(
"stepinvalid{$inputoutput}{$flowconnector}count",
'tool_dataflows',
$count
) . ' ' . visualiser::get_link_expectations($steptype, $inputoutput),
];
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
// Render the specific dataflow form.
$customdata = [
'persistent' => $persistent ?? null, // An instance, or null.
'userid' => $USER->id // For the hidden userid field.
'userid' => $USER->id, // For the hidden userid field.
];
$form = new dataflow_form($PAGE->url->out(false), $customdata);
if ($form->is_cancelled()) {
Expand Down
2 changes: 1 addition & 1 deletion tests/tool_dataflows_secret_service_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected static function form_define_fields(): array {
'secret' => ['type' => PARAM_TEXT, 'secret' => true],
'source' => ['type' => PARAM_TEXT],
'target' => ['type' => PARAM_TEXT],
'sourceremote' => ['type' => PARAM_BOOL]
'sourceremote' => ['type' => PARAM_BOOL],
];
}
}
Expand Down

0 comments on commit 709527d

Please sign in to comment.