From 2f1a0a8efa310819d6c48bb0e687850bb519352a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 17:14:59 +0200 Subject: [PATCH] fix(deps): update dependency friendsofphp/php-cs-fixer to <3.27.1 (main) (#2714) * fix(deps): update dependency friendsofphp/php-cs-fixer to <3.27.1 * style: format legacy files --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jo --- legacy/application/common/OsPath.php | 2 +- .../controllers/PreferenceController.php | 2 +- legacy/application/models/Block.php | 18 +++++++++--------- legacy/application/models/Playlist.php | 12 ++++++------ legacy/application/models/Schedule.php | 6 +++--- legacy/application/models/Tracktype.php | 2 +- legacy/application/models/User.php | 2 +- legacy/application/models/Webstream.php | 2 +- legacy/application/models/tests/populator.php | 2 +- legacy/tools/composer.json | 2 +- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/legacy/application/common/OsPath.php b/legacy/application/common/OsPath.php index 655989804..9cd0fb429 100644 --- a/legacy/application/common/OsPath.php +++ b/legacy/application/common/OsPath.php @@ -80,7 +80,7 @@ class Application_Common_OsPath } if ($dir[strlen($dir) - 1] != '/') { - $dir = $dir . '/'; + $dir .= '/'; } return $dir; diff --git a/legacy/application/controllers/PreferenceController.php b/legacy/application/controllers/PreferenceController.php index 3f8f33cb6..42a107e66 100644 --- a/legacy/application/controllers/PreferenceController.php +++ b/legacy/application/controllers/PreferenceController.php @@ -248,7 +248,7 @@ class PreferenceController extends Zend_Controller_Action $element['isError'] = true; $result[$path] = $element; } else { - $path = $path . '/'; + $path .= '/'; $handle = opendir($path); if ($handle !== false) { while (false !== ($file = readdir($handle))) { diff --git a/legacy/application/models/Block.php b/legacy/application/models/Block.php index 0ea6f8dcd..b1e954519 100644 --- a/legacy/application/models/Block.php +++ b/legacy/application/models/Block.php @@ -349,7 +349,7 @@ SQL; if ($mins > 59) { $hour = intval($mins / 60); $hour = str_pad($hour, 2, '0', STR_PAD_LEFT); - $mins = $mins % 60; + $mins %= 60; } } $hour = str_pad($hour, 2, '0', STR_PAD_LEFT); @@ -499,10 +499,10 @@ SQL; $db_file = CcFilesQuery::create()->findPk($ac[0], $this->con); $db_file->setDbIsPlaylist(true)->save($this->con); - $pos = $pos + 1; + ++$pos; } elseif (!is_array($ac)) { $res = $this->insertBlockElement($this->buildEntry($ac, $pos)); - $pos = $pos + 1; + ++$pos; $db_file = CcFilesQuery::create()->findPk($ac, $this->con); $db_file->setDbIsPlaylist(true)->save($this->con); @@ -516,7 +516,7 @@ SQL; for ($i = 0; $i < count($contentsToUpdate); ++$i) { $contentsToUpdate[$i]->setDbPosition($pos); $contentsToUpdate[$i]->save($this->con); - $pos = $pos + 1; + ++$pos; } $this->block->setDbMtime(new DateTime('now', new DateTimeZone('UTC'))); @@ -565,13 +565,13 @@ SQL; Logging::info("item {$item->getDbId()} to pos {$pos}"); $item->setDbPosition($pos); $item->save($this->con); - $pos = $pos + 1; + ++$pos; } foreach ($otherContent as $item) { Logging::info("item {$item->getDbId()} to pos {$pos}"); $item->setDbPosition($pos); $item->save($this->con); - $pos = $pos + 1; + ++$pos; } } else { Logging::info("moving items after {$p_afterItem}"); @@ -580,14 +580,14 @@ SQL; Logging::info("item {$item->getDbId()} to pos {$pos}"); $item->setDbPosition($pos); $item->save($this->con); - $pos = $pos + 1; + ++$pos; if ($item->getDbId() == $p_afterItem) { foreach ($contentsToMove as $move) { Logging::info("item {$move->getDbId()} to pos {$pos}"); $move->setDbPosition($pos); $move->save($this->con); - $pos = $pos + 1; + ++$pos; } } } @@ -1660,7 +1660,7 @@ SQL; */ } elseif (in_array($spCriteria, ['length', 'cuein', 'cueout']) && $spCriteriaModifier == 'is') { $spCriteriaModifier = 'starts with'; - $spCriteria = $spCriteria . '::text'; + $spCriteria .= '::text'; $spCriteriaValue = $criteria['value']; } else { /* Propel does not escape special characters properly when using LIKE/ILIKE diff --git a/legacy/application/models/Playlist.php b/legacy/application/models/Playlist.php index 7d878692a..2d9ee9dca 100644 --- a/legacy/application/models/Playlist.php +++ b/legacy/application/models/Playlist.php @@ -499,14 +499,14 @@ SQL; $db_file->setDbIsPlaylist(true)->save($this->con); } - $pos = $pos + 1; + ++$pos; } // reset the positions of the remaining items. for ($i = 0; $i < count($contentsToUpdate); ++$i) { $contentsToUpdate[$i]->setDbPosition($pos); $contentsToUpdate[$i]->save($this->con); - $pos = $pos + 1; + ++$pos; } $this->pl->setDbMtime(new DateTime('now', new DateTimeZone('UTC'))); @@ -553,13 +553,13 @@ SQL; Logging::info("item {$item->getDbId()} to pos {$pos}"); $item->setDbPosition($pos); $item->save($this->con); - $pos = $pos + 1; + ++$pos; } foreach ($otherContent as $item) { Logging::info("item {$item->getDbId()} to pos {$pos}"); $item->setDbPosition($pos); $item->save($this->con); - $pos = $pos + 1; + ++$pos; } } else { Logging::info("moving items after {$p_afterItem}"); @@ -568,14 +568,14 @@ SQL; Logging::info("item {$item->getDbId()} to pos {$pos}"); $item->setDbPosition($pos); $item->save($this->con); - $pos = $pos + 1; + ++$pos; if ($item->getDbId() == $p_afterItem) { foreach ($contentsToMove as $move) { Logging::info("item {$move->getDbId()} to pos {$pos}"); $move->setDbPosition($pos); $move->save($this->con); - $pos = $pos + 1; + ++$pos; } } } diff --git a/legacy/application/models/Schedule.php b/legacy/application/models/Schedule.php index daef86964..c6520ec40 100644 --- a/legacy/application/models/Schedule.php +++ b/legacy/application/models/Schedule.php @@ -514,7 +514,7 @@ SQL; ':sj_ts_5' => $p_track_start, ':sj_ts_6' => $p_track_end, ]; - $paramMap = $paramMap + $map; + $paramMap += $map; $streamSql = str_replace( '%%columns%%', @@ -540,7 +540,7 @@ SQL; } $showPredicate = ' AND show_id IN (' . implode(',', $params) . ')'; - $paramMap = $paramMap + $map; + $paramMap += $map; } elseif (count($p_show_instances) > 0) { $showPredicate = ' AND si.id IN (' . implode(',', $p_show_instances) . ')'; } @@ -584,7 +584,7 @@ SQL; ':ts_5' => $p_start_str, ':ts_6' => $p_end_str, ]; - $paramMap = $paramMap + $map; + $paramMap += $map; return Application_Common_Database::prepareAndExecute( $sql, diff --git a/legacy/application/models/Tracktype.php b/legacy/application/models/Tracktype.php index 126549a5b..039c5fc4f 100644 --- a/legacy/application/models/Tracktype.php +++ b/legacy/application/models/Tracktype.php @@ -130,7 +130,7 @@ class Application_Model_Tracktype $sql .= ' AND code ILIKE :search'; $params[':search'] = "%{$search}%"; - $sql = $sql . ' ORDER BY id'; + $sql .= ' ORDER BY id'; return Application_Common_Database::prepareAndExecute($sql, $params, 'all'); } diff --git a/legacy/application/models/User.php b/legacy/application/models/User.php index 2326a1414..9945c684f 100644 --- a/legacy/application/models/User.php +++ b/legacy/application/models/User.php @@ -311,7 +311,7 @@ class Application_Model_User $sql .= ' AND login ILIKE :search'; $params[':search'] = "%{$search}%"; - $sql = $sql . ' ORDER BY login'; + $sql .= ' ORDER BY login'; return Application_Common_Database::prepareAndExecute($sql, $params, 'all'); } diff --git a/legacy/application/models/Webstream.php b/legacy/application/models/Webstream.php index 13b92f5fc..363b69068 100644 --- a/legacy/application/models/Webstream.php +++ b/legacy/application/models/Webstream.php @@ -154,7 +154,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable // minutes cannot be over 59. Need to convert anything > 59 minutes into hours. $hours += intval($minutes / 60); - $minutes = $minutes % 60; + $minutes %= 60; $di = new DateInterval("PT{$hours}H{$minutes}M"); diff --git a/legacy/application/models/tests/populator.php b/legacy/application/models/tests/populator.php index f3c1c7a58..4de6e6455 100644 --- a/legacy/application/models/tests/populator.php +++ b/legacy/application/models/tests/populator.php @@ -105,7 +105,7 @@ while ($showTime < $endDate) { createTestShow($showNumber, $showTime); $showTime->add(new DateInterval('PT1H')); } - $showNumber = $showNumber + 1; + ++$showNumber; } if (Application_Model_RabbitMq::$doPush) { diff --git a/legacy/tools/composer.json b/legacy/tools/composer.json index b1d8bc60e..8e3b2d204 100644 --- a/legacy/tools/composer.json +++ b/legacy/tools/composer.json @@ -1,6 +1,6 @@ { "require": { "php": "^7.4", - "friendsofphp/php-cs-fixer": "<3.26.2" + "friendsofphp/php-cs-fixer": "<3.27.1" } }