From ab16cb47c5c4b4a1d183d00570a0ef87224657c2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Aug 2023 18:28:18 +0200 Subject: [PATCH] fix(deps): update dependency friendsofphp/php-cs-fixer to <3.23.1 (stable) (#2656) * fix(deps): update dependency friendsofphp/php-cs-fixer to <3.23.1 * style: format files using php-cs-fixer --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jo --- legacy/application/check.php | 1 + legacy/application/common/CeleryManager.php | 1 + legacy/application/common/HTTPHelper.php | 7 +++---- legacy/application/controllers/WebstreamController.php | 2 ++ legacy/application/models/ListenerStat.php | 1 + legacy/application/models/Show.php | 1 + legacy/application/models/User.php | 1 + legacy/application/services/ShowFormService.php | 1 + legacy/tools/composer.json | 2 +- 9 files changed, 12 insertions(+), 5 deletions(-) diff --git a/legacy/application/check.php b/legacy/application/check.php index 1269109fd..7f8ba5b75 100644 --- a/legacy/application/check.php +++ b/legacy/application/check.php @@ -40,6 +40,7 @@ function checkPhpDependencies() function checkDatabaseDependencies() { global $extensions; + // Check the PHP extension list for the Postgres db extensions return in_array('pdo_pgsql', $extensions) && in_array('pgsql', $extensions); diff --git a/legacy/application/common/CeleryManager.php b/legacy/application/common/CeleryManager.php index 3a4fa785a..70406667d 100644 --- a/legacy/application/common/CeleryManager.php +++ b/legacy/application/common/CeleryManager.php @@ -98,6 +98,7 @@ class CeleryManager throw new CeleryTimeoutException('Celery task ' . $task->getDbName() . ' with ID ' . $task->getDbTaskId() . ' timed out'); } + // The message hasn't timed out, but it's still false, which means it hasn't been // sent back from Celery yet. throw new CeleryException('Waiting on Celery task ' . $task->getDbName() . ' with ID ' . $task->getDbTaskId()); diff --git a/legacy/application/common/HTTPHelper.php b/legacy/application/common/HTTPHelper.php index 1db6eed4b..3047685cc 100644 --- a/legacy/application/common/HTTPHelper.php +++ b/legacy/application/common/HTTPHelper.php @@ -52,10 +52,9 @@ class Application_Common_HTTPHelper class ZendActionHttpException extends Exception { /** - * @param int $statusCode - * @param string $message - * @param int $code - * @param Exception $previous + * @param int $statusCode + * @param string $message + * @param int $code * * @throws Zend_Controller_Response_Exception */ diff --git a/legacy/application/controllers/WebstreamController.php b/legacy/application/controllers/WebstreamController.php index a823511bf..a7ec0698e 100644 --- a/legacy/application/controllers/WebstreamController.php +++ b/legacy/application/controllers/WebstreamController.php @@ -116,9 +116,11 @@ class WebstreamController extends Zend_Controller_Action /*we are updating a playlist. Ensure that if the user is a host/dj, that he has the correct permission.*/ $user = Application_Model_User::getCurrentUser(); + // only allow when webstream belongs to the DJ return $webstream->getDbCreatorId() == $user->getId(); } + /*we are creating a new stream. Don't need to check whether the DJ/Host owns the stream*/ return true; diff --git a/legacy/application/models/ListenerStat.php b/legacy/application/models/ListenerStat.php index 96713ffc7..ec19fb4f6 100644 --- a/legacy/application/models/ListenerStat.php +++ b/legacy/application/models/ListenerStat.php @@ -125,6 +125,7 @@ SQL; foreach ($data as $show_id) { $all_show_data = array_merge(self::getShowDataPointsWithinRange($p_start, $p_end, $show_id['show_id']), $all_show_data); } + /* option to sort by number of listeners currently commented out usort($all_show_data, function($a, $b) { return $a['average_number_of_listeners'] - $b['average_number_of_listeners']; diff --git a/legacy/application/models/Show.php b/legacy/application/models/Show.php index 8efef314d..50a6c2451 100644 --- a/legacy/application/models/Show.php +++ b/legacy/application/models/Show.php @@ -1209,6 +1209,7 @@ SQL; $row = intval($date->format('w')) % count($palette); $foo = $date->format('H'); $col = intval(intval($date->format('H')) / 24.0 * count($palette[0])); + // $color = $palette[$hashValue % sizeof($palette)]; return $palette[$row][$col]; } diff --git a/legacy/application/models/User.php b/legacy/application/models/User.php index aac98773e..2326a1414 100644 --- a/legacy/application/models/User.php +++ b/legacy/application/models/User.php @@ -227,6 +227,7 @@ class Application_Model_User public function getOwnedFiles() { $user = $this->_userInstance; + // do we need a find call at the end here? return $user->getCcFilessRelatedByDbOwnerId(); } diff --git a/legacy/application/services/ShowFormService.php b/legacy/application/services/ShowFormService.php index ba207389c..3935a4189 100644 --- a/legacy/application/services/ShowFormService.php +++ b/legacy/application/services/ShowFormService.php @@ -401,6 +401,7 @@ class Application_Service_ShowFormService Logging::error('Failed to read image: ' . $path); $imageData = null; } + // return the data URI - data:{mime};base64,{data} return ($imageData === null || $imageData === '') ? '' : 'data: ' . mime_content_type($path) . ';base64,' . $imageData; diff --git a/legacy/tools/composer.json b/legacy/tools/composer.json index a7bc871cb..8f7076440 100644 --- a/legacy/tools/composer.json +++ b/legacy/tools/composer.json @@ -1,6 +1,6 @@ { "require": { "php": "^7.4", - "friendsofphp/php-cs-fixer": "<3.22.1" + "friendsofphp/php-cs-fixer": "<3.23.1" } }