Skip to content

Commit

Permalink
[Coding Style] Enable rule PSR12.ControlStructures.BooleanOperatorPla…
Browse files Browse the repository at this point in the history
…cement.FoundMixed (#21730)

* Enable rule PSR12.ControlStructures.BooleanOperatorPlacement.FoundMixed

* autoapply cs
  • Loading branch information
sgiehl authored Dec 21, 2023
1 parent 8f6e92f commit 2e3c515
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 20 deletions.
14 changes: 7 additions & 7 deletions core/CronArchive.php
Original file line number Diff line number Diff line change
Expand Up @@ -1406,13 +1406,13 @@ private function hasReachedMaxConcurrentArchivers()
foreach ($processes as $process) {
if (strpos($process, ' core:archive') !== false &&
strpos($process, 'console ') !== false &&
(!$instanceId
|| strpos($process, '--matomo-domain=' . $instanceId) !== false
|| strpos($process, '--matomo-domain="' . $instanceId . '"') !== false
|| strpos($process, '--matomo-domain=\'' . $instanceId . "'") !== false
|| strpos($process, '--piwik-domain=' . $instanceId) !== false
|| strpos($process, '--piwik-domain="' . $instanceId . '"') !== false
|| strpos($process, '--piwik-domain=\'' . $instanceId . "'") !== false)) {
(!$instanceId ||
strpos($process, '--matomo-domain=' . $instanceId) !== false ||
strpos($process, '--matomo-domain="' . $instanceId . '"') !== false ||
strpos($process, '--matomo-domain=\'' . $instanceId . "'") !== false ||
strpos($process, '--piwik-domain=' . $instanceId) !== false ||
strpos($process, '--piwik-domain="' . $instanceId . '"') !== false ||
strpos($process, '--piwik-domain=\'' . $instanceId . "'") !== false)) {
$numRunning++;
}
}
Expand Down
4 changes: 2 additions & 2 deletions core/Nonce.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ public static function verifyNonceWithErrorMessage($id, $cnonce, $allowedReferre
// validate origin
$origin = self::getOrigin();
if (!empty($origin) &&
($origin == 'null'
|| !in_array($origin, self::getAcceptableOrigins()))
($origin == 'null' ||
!in_array($origin, self::getAcceptableOrigins()))
) {
return Piwik::translate('Login_InvalidNonceOrigin') . $additionalErrors;
}
Expand Down
6 changes: 3 additions & 3 deletions core/Period/Range.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@ protected function processOptimalSubperiods($startDate, $endDate)
$endOfPeriod = $endOfMonth;
} // If end of this week is later than end date, we use days
elseif ($this->isEndOfWeekLaterThanEndDate($endDate, $endOfWeek) &&
($endOfWeek->isEarlier($this->today)
|| $startOfWeek->toString() != $startDate->toString()
|| $endDate->isEarlier($this->today))
($endOfWeek->isEarlier($this->today) ||
$startOfWeek->toString() != $startDate->toString() ||
$endDate->isEarlier($this->today))
) {
$this->fillArraySubPeriods($startDate, $endDate, 'day');
break 1;
Expand Down
4 changes: 2 additions & 2 deletions core/Plugin/Visualization.php
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,8 @@ protected function getClientSideParametersToSet()

if ($this->dataTable &&
// Set doesn't have the method
!($this->dataTable instanceof DataTable\Map)
&& empty($javascriptVariablesToSet['totalRows'])
!($this->dataTable instanceof DataTable\Map) &&
empty($javascriptVariablesToSet['totalRows'])
) {
$javascriptVariablesToSet['totalRows'] =
$this->dataTable->getMetadata(DataTable::TOTAL_ROWS_BEFORE_LIMIT_METADATA_NAME) ?: $this->dataTable->getRowsCount();
Expand Down
4 changes: 2 additions & 2 deletions core/ReportRenderer/Pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ private function paintReportHeader()
$rowCount = $reportHasData ? $this->report->getRowsCount() + self::TABLE_HEADER_ROW_COUNT : self::NO_DATA_ROW_COUNT;

// Only a page break before if the current report has some data
if ($reportHasData &&
if ($reportHasData
// and
(
&& (
// it is the first report
$this->currentPage == 0
// or, it is a graph-only report and it is the first of a series of self::MAX_GRAPH_REPORTS
Expand Down
6 changes: 3 additions & 3 deletions core/Updates/4.0.0-b1.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ public static function ensureCorePluginsThatWereMovedToMarketplaceCanBeUpdated()
$pluginDir = Manager::getPluginDirectory($plugin);

if (is_dir($pluginDir) &&
file_exists($pluginDir . '/' . $plugin . '.php')
&& !file_exists($pluginDir . '/plugin.json')
&& is_writable($pluginDir)) {
file_exists($pluginDir . '/' . $plugin . '.php') &&
!file_exists($pluginDir . '/plugin.json') &&
is_writable($pluginDir)) {
file_put_contents($pluginDir . '/plugin.json', '{
"name": "' . $plugin . '",
"description": "' . $plugin . '",
Expand Down
1 change: 0 additions & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<exclude name="Generic.Files.LineLength" />
<exclude name="Generic.PHP.LowerCaseConstant.Found" />
<exclude name="Generic.PHP.LowerCaseKeyword.Found" />
<exclude name="PSR12.ControlStructures.BooleanOperatorPlacement.FoundMixed" />
<exclude name="PSR12.ControlStructures.ControlStructureSpacing.CloseParenthesisIndent" />
<exclude name="PSR12.ControlStructures.ControlStructureSpacing.CloseParenthesisLine" />
<exclude name="PSR12.ControlStructures.ControlStructureSpacing.FirstExpressionLine" />
Expand Down

0 comments on commit 2e3c515

Please sign in to comment.