Skip to content

Commit be81d28

Browse files
Enable PHPCS rule to enforce array trailing comma for multiline arrays (#23600)
1 parent dc05377 commit be81d28

749 files changed

Lines changed: 2572 additions & 2570 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/API/DataTableGenericFilter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static function getGenericFiltersInformation()
8383
array('Pattern',
8484
array(
8585
'filter_column' => array('string', 'label'),
86-
'filter_pattern' => array('string')
86+
'filter_pattern' => array('string'),
8787
)),
8888
array('PatternRecursive',
8989
array(
@@ -101,7 +101,7 @@ public static function getGenericFiltersInformation()
101101
'filter_sort_order' => array('string', 'desc'),
102102
$naturalSort = true,
103103
$recursiveSort = true,
104-
'filter_sort_column_secondary' => true
104+
'filter_sort_column_secondary' => true,
105105
)),
106106
array('Truncate',
107107
array(
@@ -112,7 +112,7 @@ public static function getGenericFiltersInformation()
112112
'filter_offset' => array('integer', '0'),
113113
'filter_limit' => array('integer'),
114114
'keep_summary_row' => array('integer', '0'),
115-
))
115+
)),
116116
);
117117
}
118118

@@ -212,7 +212,7 @@ public function areProcessedMetricsNeededFor($metrics)
212212
'filter_column',
213213
'filter_column_recursive',
214214
'filter_excludelowpop',
215-
'filter_sort_column'
215+
'filter_sort_column',
216216
);
217217

218218
foreach ($columnQueryParameters as $queryParamName) {

core/API/DocumentationGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ protected function addExamples($class, $methodName, $prefixUrls)
137137
$parametersToSet = array(
138138
'idSite' => Common::getRequestVar('idSite', 1, 'int'),
139139
'period' => Common::getRequestVar('period', 'day', 'string'),
140-
'date' => Common::getRequestVar('date', 'today', 'string')
140+
'date' => Common::getRequestVar('date', 'today', 'string'),
141141
);
142142
$str = '';
143143
$str .= "<span class=\"example\">";
@@ -252,7 +252,7 @@ public function getExampleUrl($class, $methodName, $parametersToSet = array())
252252
'updateGoal',
253253
'deleteGoal',
254254
//Marketplace
255-
'deleteLicenseKey'
255+
'deleteLicenseKey',
256256
);
257257

258258
if (in_array($methodName, $doNotPrintExampleForTheseMethods)) {

core/Access/Role/Admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function getId(): string
3030
public function getDescription(): string
3131
{
3232
return Piwik::translate('UsersManager_PrivAdminDescription', [
33-
Piwik::translate('UsersManager_PrivWrite')
33+
Piwik::translate('UsersManager_PrivWrite'),
3434
]);
3535
}
3636

core/Access/RolesProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function getAllRoles(): array
2525
return array(
2626
new View(),
2727
new Write(),
28-
new Admin()
28+
new Admin(),
2929
);
3030
}
3131

core/Application/Kernel/PluginList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ class PluginList
4646
'ExampleAPI',
4747
'ExampleVue',
4848
'MobileAppMeasurable',
49-
'TagManager'
49+
'TagManager',
5050
);
5151

5252
// Themes bundled with core package, disabled by default
5353
private $coreThemesDisabledByDefault = array(
54-
'ExampleTheme'
54+
'ExampleTheme',
5555
);
5656

5757
public function __construct(GlobalSettingsProvider $settings)

core/Archive/ArchivePurger.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ public function purgeInvalidatedArchivesFrom(Date $date)
101101
}
102102

103103
$this->logger->info("Found {countArchiveIds} invalidated archives safe to delete in {table}.", array(
104-
'table' => $numericTable, 'countArchiveIds' => count($archiveIds)
104+
'table' => $numericTable, 'countArchiveIds' => count($archiveIds),
105105
));
106106

107107
$deletedRowCount = $this->deleteArchiveIds($date, $archiveIds);
108108

109109
$this->logger->debug("Deleted {count} rows in {table} and its associated blob table.", array(
110-
'table' => $numericTable, 'count' => $deletedRowCount
110+
'table' => $numericTable, 'count' => $deletedRowCount,
111111
));
112112

113113
return $deletedRowCount;
@@ -133,7 +133,7 @@ public function purgeOutdatedArchives(Date $dateStart)
133133

134134
$this->logger->info("Deleted {count} rows in archive tables (numeric + blob) for {date}.", array(
135135
'count' => $deletedRowCount,
136-
'date' => $dateStart
136+
'date' => $dateStart,
137137
));
138138
} else {
139139
$this->logger->debug("No outdated archives found in archive numeric table for {date}.", array('date' => $dateStart));
@@ -177,7 +177,7 @@ public function purgeBrokenArchives(Month $startMonth, ?Month $endMonth = null):
177177

178178
$this->logger->info("Deleted {count} rows in archive tables (numeric + blob) for month starting {monthStart}.", [
179179
'count' => $deletedRowCount,
180-
'monthStart' => $currentMonthStart->toString('Y-m')
180+
'monthStart' => $currentMonthStart->toString('Y-m'),
181181
]);
182182
} else {
183183
$this->logger->debug("No broken archives found in archive numeric table for month starting {monthStart}.", ['monthStart' => $currentMonthStart->toString('Y-m')]);
@@ -186,7 +186,7 @@ public function purgeBrokenArchives(Month $startMonth, ?Month $endMonth = null):
186186
$numRowsDeleted += $deletedRowCount;
187187
$this->logger->debug("Purging broken archives: done [ purged archives in {yearMonth} ] [Deleted IDs count: {deletedIds}]", [
188188
'yearMonth' => $currentMonthStart->toString('Y-m'),
189-
'deletedIds' => $deletedRowCount
189+
'deletedIds' => $deletedRowCount,
190190
]);
191191
$currentMonth = new Month($currentMonthStart->addMonth(1));
192192
$currentMonthStart = $currentMonth->getDateStart();
@@ -236,7 +236,7 @@ protected function purge(array $idArchivesToDelete, Date $dateStart, $reason): i
236236
array(
237237
'count' => $deletedRowCount,
238238
'date' => $dateStart,
239-
'reason' => $reason
239+
'reason' => $reason,
240240
)
241241
);
242242

@@ -321,7 +321,7 @@ public function purgeArchivesWithPeriodRange(Date $date)
321321
$this->logger->$level("Purged {count} range archive rows from {numericTable} & {blobTable}.", array(
322322
'count' => $deletedCount,
323323
'numericTable' => $numericTable,
324-
'blobTable' => $blobTable
324+
'blobTable' => $blobTable,
325325
));
326326

327327
$this->logger->debug(" [ purged archives older than {threshold} ]", array('threshold' => $this->purgeCustomRangesOlderThan));

core/ArchiveProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ protected function enrichWithUniqueVisitorsMetric(Row $row)
552552

553553
$metrics = array(
554554
Metrics::INDEX_NB_USERS,
555-
$uniqueVisitorsMetric
555+
$uniqueVisitorsMetric,
556556
);
557557

558558
$uniques = $this->computeNbUniques($metrics, $sites);

core/ArchiveProcessor/Loader.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -504,41 +504,41 @@ public function canSkipThisArchiveWithReason(): array
504504
if ($canSkipArchiveForSegment[0]) {
505505
return [
506506
true,
507-
'Skip archive for segment: ' . $canSkipArchiveForSegment[1]
507+
'Skip archive for segment: ' . $canSkipArchiveForSegment[1],
508508
];
509509
}
510510

511511
if (!$isWebsiteUsingTracker) {
512512
return [
513513
false,
514-
'Site is not using the JavaScript tracker'
514+
'Site is not using the JavaScript tracker',
515515
];
516516
}
517517

518518
if ($isArchivingForcedWhenNoVisits) {
519519
return [
520520
false,
521-
'Archiving is forced when no visits'
521+
'Archiving is forced when no visits',
522522
];
523523
}
524524

525525
if ($hasSiteVisitsBetweenTimeframe) {
526526
return [
527527
false,
528-
'Site has visits between start and end date'
528+
'Site has visits between start and end date',
529529
];
530530
}
531531

532532
if ($hasChildArchivesInPeriod) {
533533
return [
534534
false,
535-
'There are child archives in the period'
535+
'There are child archives in the period',
536536
];
537537
}
538538

539539
return [
540540
true,
541-
'Site is using tracker & archiving is not forced when no visits & site has has no visits between start and end date & there are no child archives in the period'
541+
'Site is using tracker & archiving is not forced when no visits & site has has no visits between start and end date & there are no child archives in the period',
542542
];
543543
}
544544

core/ArchiveProcessor/PluginsArchiver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ public function callAggregateCoreMetrics()
112112
if (empty($metrics)) {
113113
return array(
114114
'nb_visits' => false,
115-
'nb_visits_converted' => false
115+
'nb_visits_converted' => false,
116116
);
117117
}
118118
return array(
119119
'nb_visits' => $metrics['nb_visits'],
120-
'nb_visits_converted' => $metrics['nb_visits_converted']
120+
'nb_visits_converted' => $metrics['nb_visits_converted'],
121121
);
122122
}
123123

core/Auth/PasswordStrength.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,23 @@ public function getRules(): array
4343
return [
4444
[
4545
'validationRegex' => '/^.{12,}$/',
46-
'ruleText' => Piwik::translate('General_PasswordStrengthValidationLength')
46+
'ruleText' => Piwik::translate('General_PasswordStrengthValidationLength'),
4747
],
4848
[
4949
'validationRegex' => '/^.*[a-z].*$/',
50-
'ruleText' => Piwik::translate('General_PasswordStrengthValidationLowercase')
50+
'ruleText' => Piwik::translate('General_PasswordStrengthValidationLowercase'),
5151
],
5252
[
5353
'validationRegex' => '/^.*[A-Z].*$/',
54-
'ruleText' => Piwik::translate('General_PasswordStrengthValidationUppercase')
54+
'ruleText' => Piwik::translate('General_PasswordStrengthValidationUppercase'),
5555
],
5656
[
5757
'validationRegex' => '/^.*[0-9].*$/',
58-
'ruleText' => Piwik::translate('General_PasswordStrengthValidationNumber')
58+
'ruleText' => Piwik::translate('General_PasswordStrengthValidationNumber'),
5959
],
6060
[
6161
'validationRegex' => '/^.*[!\"#$%&\\\'(\\\\)*+,\-.\/:;<=>?@[\\]^_\`{\|}\~].*$/',
62-
'ruleText' => Piwik::translate('General_PasswordStrengthValidationSpecialChar')
62+
'ruleText' => Piwik::translate('General_PasswordStrengthValidationSpecialChar'),
6363
],
6464
];
6565
}

0 commit comments

Comments
 (0)