Feature: Support php7.4 (#1354)

* Run CI tests against php 7.4

* Sort composer dependencies

* Remove unused Aws S3 php library

* Pin simplepie dependency to ^1.5

* Pin getid3 dependency to ^1.9

* Pin composer semver to ^3.2

* Pin php-amqplib to ^2.12

* Drop sentry logging support

* Update composer dependencies

* Move propel regenerate to Makefile

* Regenerate propel files with v1.7.0

* Pin propel orm to ^1.7

* Regenerate propel files with v1.7.2

* fix: generator_version in airtime-conf-production.php

* Replace propel/propel1 with jooola/propel1

* Regenerate propel files with v1.7.3-dev

* Fix php7.4 compatibility

Using php-cs-fixer:

    '@PhpCsFixer' => true,
    'concat_space' => ['spacing' => 'one'],
    'ordered_class_elements' => false,
    'yoda_style' => false,
    '@PHP74Migration' => true,
    'assign_null_coalescing_to_coalesce_equal' => false,
    'ternary_to_null_coalescing' => false,
    'heredoc_indentation' => false,
    '@PHP74Migration:risky' => true,
    'declare_strict_types' => false,
    'void_return' => false,
    'use_arrow_functions' => false,

* Fix pre-commit
This commit is contained in:
Jonas L 2021-10-17 17:19:53 +02:00 committed by GitHub
parent 30b3470a06
commit 5e8d8db6e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
90 changed files with 887 additions and 1310 deletions

View file

@ -1344,7 +1344,7 @@ class ApiController extends Zend_Controller_Action
$data = json_decode($request->getParam('data'));
foreach ($data as $pair) {
list($id, $gain) = $pair;
[$id, $gain] = $pair;
// TODO : move this code into model -- RG
$file = Application_Model_StoredFile::RecallById($p_id = $id)->getPropelOrm();
$file->setDbReplayGain($gain);
@ -1360,7 +1360,7 @@ class ApiController extends Zend_Controller_Action
$data = json_decode($request->getParam('data'), $assoc = true);
foreach ($data as $pair) {
list($id, $info) = $pair;
[$id, $info] = $pair;
// TODO : move this code into model -- RG
$file = Application_Model_StoredFile::RecallById($p_id = $id)->getPropelOrm();
@ -1504,7 +1504,7 @@ class ApiController extends Zend_Controller_Action
$params = $request->getParams();
$instance = $request->getParam('instance_id', null);
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
$historyService = new Application_Service_HistoryService();
$results = $historyService->getPlayedItemData($startsDT, $endsDT, $params, $instance);
@ -1528,7 +1528,7 @@ class ApiController extends Zend_Controller_Action
$params = $request->getParams();
$userId = $request->getParam('user_id', null);
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
$historyService = new Application_Service_HistoryService();
$shows = $historyService->getShowList($startsDT, $endsDT, $userId);
@ -1582,7 +1582,7 @@ class ApiController extends Zend_Controller_Action
$params = $request->getParams();
$showId = $request->getParam('show_id', null);
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
if ((!isset($showId)) || (!is_numeric($showId))) {
//if (!isset($showId)) {

View file

@ -283,8 +283,8 @@ class LibraryController extends Zend_Controller_Action
$newPl->setCreator(Application_Model_User::getCurrentUser()->getId());
$newPl->setDescription($originalPl->getDescription());
list($plFadeIn) = $originalPl->getFadeInfo(0);
list(, $plFadeOut) = $originalPl->getFadeInfo($originalPl->getSize() - 1);
[$plFadeIn] = $originalPl->getFadeInfo(0);
[, $plFadeOut] = $originalPl->getFadeInfo($originalPl->getSize() - 1);
$newPl->setfades($plFadeIn, $plFadeOut);
$newPl->setName(sprintf(_('Copy of %s'), $originalPl->getName()));

View file

@ -29,7 +29,7 @@ class ListenerstatController extends Zend_Controller_Action
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/utilities/utilities.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl . 'css/jquery.ui.timepicker.css?' . $CC_CONFIG['airtime_version']);
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
$userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
$startsDT->setTimezone($userTimezone);
$endsDT->setTimezone($userTimezone);
@ -85,7 +85,7 @@ class ListenerstatController extends Zend_Controller_Action
$form = new Application_Form_ShowListenerStat();
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
$userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
$startsDT->setTimezone($userTimezone);
$endsDT->setTimezone($userTimezone);
@ -101,7 +101,7 @@ class ListenerstatController extends Zend_Controller_Action
public function getDataAction()
{
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
$data = Application_Model_ListenerStat::getDataPointsWithinRange(
$startsDT->format(DEFAULT_TIMESTAMP_FORMAT),
$endsDT->format(DEFAULT_TIMESTAMP_FORMAT)
@ -111,7 +111,7 @@ class ListenerstatController extends Zend_Controller_Action
public function getShowDataAction()
{
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
$show_id = $this->getRequest()->getParam('show_id', null);
$data = Application_Model_ListenerStat::getShowDataPointsWithinRange(
$startsDT->format(DEFAULT_TIMESTAMP_FORMAT),
@ -123,7 +123,7 @@ class ListenerstatController extends Zend_Controller_Action
public function getAllShowData()
{
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
return Application_Model_ListenerStat::getAllShowDataPointsWithinRange(
$startsDT->format(DEFAULT_TIMESTAMP_FORMAT),
@ -133,7 +133,7 @@ class ListenerstatController extends Zend_Controller_Action
public function getAllShowDataAction()
{
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
$show_id = $this->getRequest()->getParam('show_id', null);
$data = Application_Model_ListenerStat::getAllShowDataPointsWithinRange(
$startsDT->format(DEFAULT_TIMESTAMP_FORMAT),

View file

@ -27,7 +27,7 @@ class PlayouthistoryController extends Zend_Controller_Action
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
$userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
$startsDT->setTimezone($userTimezone);
@ -83,7 +83,7 @@ class PlayouthistoryController extends Zend_Controller_Action
$params = $request->getParams();
$instance = $request->getParam('instance_id', null);
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
$historyService = new Application_Service_HistoryService();
$r = $historyService->getFileSummaryData($startsDT, $endsDT, $params);
@ -106,7 +106,7 @@ class PlayouthistoryController extends Zend_Controller_Action
$params = $request->getParams();
$instance = $request->getParam('instance_id', null);
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
$historyService = new Application_Service_HistoryService();
$r = $historyService->getPlayedItemData($startsDT, $endsDT, $params, $instance);
@ -129,7 +129,7 @@ class PlayouthistoryController extends Zend_Controller_Action
$params = $request->getParams();
$instance = $request->getParam('instance_id', null);
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
$historyService = new Application_Service_HistoryService();
$shows = $historyService->getShowList($startsDT, $endsDT);

View file

@ -174,7 +174,7 @@ class PluploadController extends Zend_Controller_Action
if ($unit) {
// Find the position of the unit in the ordered string which is the power
// of magnitude to multiply a kilobyte by.
return round($size * pow(1024, stripos('bkmgtpezy', $unit[0])));
return round($size * 1024 ** stripos('bkmgtpezy', $unit[0]));
}
return round($size);

View file

@ -148,11 +148,11 @@ class ScheduleController extends Zend_Controller_Action
$calendar_interval = Application_Model_Preference::GetCalendarTimeScale();
if ($calendar_interval == 'agendaDay') {
list($start, $end) = Application_Model_Show::getStartEndCurrentDayView();
[$start, $end] = Application_Model_Show::getStartEndCurrentDayView();
} elseif ($calendar_interval == 'agendaWeek') {
list($start, $end) = Application_Model_Show::getStartEndCurrentWeekView();
[$start, $end] = Application_Model_Show::getStartEndCurrentWeekView();
} elseif ($calendar_interval == 'month') {
list($start, $end) = Application_Model_Show::getStartEndCurrentMonthPlusView();
[$start, $end] = Application_Model_Show::getStartEndCurrentMonthPlusView();
} else {
Logging::error("Invalid Calendar Interval '{$calendar_interval}'");
}
@ -487,7 +487,7 @@ class ScheduleController extends Zend_Controller_Action
$forms = $this->createShowFormAction();
list($data, $validateStartDate, $validateStartTime, $originalShowStartDateTime) =
[$data, $validateStartDate, $validateStartTime, $originalShowStartDateTime] =
$service_showForm->preEditShowValidationCheck($data);
if ($service_showForm->validateShowForms(
@ -548,7 +548,7 @@ class ScheduleController extends Zend_Controller_Action
$forms = $this->createShowFormAction();
list($data, $validateStartDate, $validateStartTime, $originalShowStartDateTime) =
[$data, $validateStartDate, $validateStartTime, $originalShowStartDateTime] =
$service_showForm->preEditShowValidationCheck($data);
if ($service_showForm->validateShowForms(

View file

@ -195,7 +195,7 @@ class ShowbuilderController extends Zend_Controller_Action
$timestamp = intval($request->getParam('timestamp', -1));
$instances = $request->getParam('instances', []);
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
$opts = ['myShows' => $my_shows, 'showFilter' => $show_filter];
$showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts);
@ -217,7 +217,7 @@ class ShowbuilderController extends Zend_Controller_Action
$show_instance_filter = intval($request->getParam('showInstanceFilter', 0));
$my_shows = intval($request->getParam('myShows', 0));
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request);
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
$opts = ['myShows' => $my_shows,
'showFilter' => $show_filter,

View file

@ -146,7 +146,7 @@ class WebstreamController extends Zend_Controller_Action
return;
}
list($analysis, $mime, $mediaUrl, $di) = Application_Model_Webstream::analyzeFormData($parameters);
[$analysis, $mime, $mediaUrl, $di] = Application_Model_Webstream::analyzeFormData($parameters);
try {
if (Application_Model_Webstream::isValid($analysis)) {

View file

@ -118,7 +118,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
if (!$csrf_namespace->authtoken) {
// If we don't have a token, regenerate it and set a 1 week timeout
// Should we log the user out here if the token is expired?
$csrf_namespace->authtoken = sha1(uniqid(rand(), 1));
$csrf_namespace->authtoken = sha1(uniqid(random_int(0, getrandmax()), 1));
$csrf_namespace->setExpirationSeconds(168 * 60 * 60);
}

View file

@ -9,7 +9,7 @@ class RabbitMqPlugin extends Zend_Controller_Plugin_Abstract
Application_Model_RabbitMq::SendMessageToPypo('update_schedule', $md);
}
if (memory_get_peak_usage() > 30 * pow(2, 20)) {
if (memory_get_peak_usage() > 30 * 2 ** 20) {
Logging::debug('Peak memory usage: '
. (memory_get_peak_usage() / 1000000)
. ' MB while accessing URI ' . $_SERVER['REQUEST_URI']);