From 4d393fa14e01949ddba790af0485fbf8241c3858 Mon Sep 17 00:00:00 2001 From: Jonas L Date: Thu, 7 Jul 2022 20:01:15 +0200 Subject: [PATCH] style(legacy): format files (#1946) --- legacy/application/auth/adapters/FreeIpa.php | 1 + legacy/application/common/WidgetHelper.php | 6 +- legacy/application/common/widgets/Table.php | 7 +- legacy/application/configs/config-check.php | 361 +++++++++--------- legacy/application/configs/navigation.php | 1 + .../controllers/AudiopreviewController.php | 3 +- .../controllers/FeedsController.php | 3 +- .../controllers/LocaleController.php | 6 +- .../controllers/PlaylistController.php | 4 +- .../controllers/ScheduleController.php | 20 +- .../controllers/ShowbuilderController.php | 8 +- .../controllers/UserController.php | 12 +- .../controllers/plugins/Acl_plugin.php | 12 +- .../plugins/PageLayoutInitPlugin.php | 3 +- .../application/forms/AddShowLiveStream.php | 6 +- legacy/application/forms/AddShowStyle.php | 6 +- legacy/application/forms/AddShowWhen.php | 19 +- legacy/application/forms/DateRange.php | 12 +- legacy/application/forms/EditAudioMD.php | 3 +- legacy/application/forms/EditUser.php | 3 +- .../application/forms/GeneralPreferences.php | 12 +- .../forms/LiveStreamingPreferences.php | 15 +- legacy/application/forms/Login.php | 3 +- legacy/application/forms/PasswordChange.php | 6 +- .../application/forms/PodcastPreferences.php | 3 +- .../forms/SetupLanguageTimezone.php | 3 +- legacy/application/forms/ShowBuilder.php | 12 +- legacy/application/forms/ShowListenerStat.php | 12 +- .../application/forms/SmartBlockCriteria.php | 56 ++- .../forms/StreamSettingSubForm.php | 47 +-- .../forms/customfilters/ImageSize.php | 1 + .../customvalidators/ConditionalNotEmpty.php | 1 + legacy/application/models/Block.php | 21 +- legacy/application/models/Dashboard.php | 66 ++-- legacy/application/models/Datatables.php | 3 +- legacy/application/models/ListenerStat.php | 11 +- legacy/application/models/LiveLog.php | 38 +- legacy/application/models/Playlist.php | 22 +- legacy/application/models/Preference.php | 18 +- legacy/application/models/Scheduler.php | 17 +- legacy/application/models/Show.php | 66 ++-- legacy/application/models/ShowBuilder.php | 33 +- legacy/application/models/ShowInstance.php | 18 +- legacy/application/models/StreamSetting.php | 16 +- legacy/application/models/Subjects.php | 1 + legacy/application/models/Tracktype.php | 3 +- legacy/application/models/User.php | 9 +- legacy/application/models/Webstream.php | 6 +- .../models/tests/StoredFileTests.php | 13 +- .../models/tests/plistEmbedded.xml | 20 +- legacy/application/models/tests/wstream1.xml | 8 +- legacy/application/modules/rest/Bootstrap.php | 3 +- .../controllers/PodcastEpisodesController.php | 2 +- .../rest/controllers/ShowImageController.php | 4 +- .../modules/rest/helpers/RestAuth.php | 3 +- .../application/services/CalendarService.php | 42 +- .../application/services/HistoryService.php | 70 ++-- .../services/PodcastEpisodeService.php | 5 +- .../application/services/SchedulerService.php | 4 +- .../application/services/ShowFormService.php | 30 +- legacy/application/services/ShowService.php | 78 ++-- .../services/ThirdPartyService.php | 2 +- .../views/helpers/SourceSwitchStatus.php | 6 +- .../views/helpers/VersionNotify.php | 2 +- .../models/unit/ScheduleUnitTest.php | 6 +- .../services/unit/ShowServiceUnitTest.php | 27 +- 66 files changed, 775 insertions(+), 565 deletions(-) diff --git a/legacy/application/auth/adapters/FreeIpa.php b/legacy/application/auth/adapters/FreeIpa.php index 24d78d42a..239592134 100644 --- a/legacy/application/auth/adapters/FreeIpa.php +++ b/legacy/application/auth/adapters/FreeIpa.php @@ -1,4 +1,5 @@ - - - - - + body { + padding: 2em; + min-width: 600px; + text-align: center; + margin: 3em; + border: 1px solid lightgray; + border-radius: 5px; + } + - -

-
- Configuration Checklist -

+ +

+
+ Configuration Checklist +

- -
-

Looks like something went wrong!

-

- Take a look at the checklist below for possible solutions. If you're tried the suggestions and are - still experiencing issues, read the - release notes, - come visit our discourse - or, check the website and main docs. -

- -

- Your Airtime station is up and running! Get started by logging in with the default username and password: admin/admin -

- - +
+

Looks like something went wrong!

+

+ Take a look at the checklist below for possible solutions. If you're tried the suggestions and are + still experiencing issues, read the + release notes, + come visit our discourse + or, check the website and main docs. +

+ +

+ Your Airtime station is up and running! Get started by logging in with the default username and password: admin/admin +

+ + - - - - - - +
- Component - - Description - - Status or Solution -
+ + + + + + + +
+ Component + + Description + + Status or Solution +
+ +
+ + + + + + + - +
+ PHP Dependencies +
+ Postgres + + PDO and PostgreSQL libraries + + "> + Try running sudo apt-get install php5-pgsql + +
-
- - - - - - - - - -
- PHP Dependencies -
- Postgres - - PDO and PostgreSQL libraries - - "> - Try running sudo apt-get install php5-pgsql - -
- - - - +
- External Services -
+ + @@ -154,17 +155,17 @@ $result = $r1 && $r2; RabbitMQ configuration for Airtime @@ -175,17 +176,17 @@ $result = $r1 && $r2; @@ -196,17 +197,17 @@ $result = $r1 && $r2; @@ -217,17 +218,17 @@ $result = $r1 && $r2; @@ -238,17 +239,17 @@ $result = $r1 && $r2; @@ -259,38 +260,38 @@ $result = $r1 && $r2; - -
+ External Services +
Database @@ -134,16 +135,16 @@ $result = $r1 && $r2; Database configuration for Airtime + echo 'check'; ?>"> "> - Make sure you aren't missing any of the Postgres dependencies in the table above. - If your dependencies check out, make sure your database configuration settings in - are correct and the Airtime database was installed correctly. - + } else { + ?>"> + Make sure you aren't missing any of the Postgres dependencies in the table above. + If your dependencies check out, make sure your database configuration settings in + are correct and the Airtime database was installed correctly. +
+ echo 'check'; ?>"> "> - Make sure RabbitMQ is installed correctly, and that your settings in - are correct. Try using sudo rabbitmqctl list_users and sudo rabbitmqctl list_vhosts - to see if the airtime user (or your custom RabbitMQ user) exists, then checking that - sudo rabbitmqctl list_exchanges contains entries for airtime-pypo and airtime-uploads. - + } else { + ?>"> + Make sure RabbitMQ is installed correctly, and that your settings in + are correct. Try using sudo rabbitmqctl list_users and sudo rabbitmqctl list_vhosts + to see if the airtime user (or your custom RabbitMQ user) exists, then checking that + sudo rabbitmqctl list_exchanges contains entries for airtime-pypo and airtime-uploads. +
+ echo 'check'; ?>"> "> - /etc/systemd/system/, - -
systemctl status libretime-analyzer
-
sudo systemctl restart libretime-analyzer - + } else { + ?>"> + /etc/systemd/system/, + +
systemctl status libretime-analyzer
+
sudo systemctl restart libretime-analyzer +
+ echo 'check'; ?>"> "> - /etc/systemd/system/, - -
systemctl status libretime-playout
-
sudo systemctl restart libretime-playout - + } else { + ?>"> + /etc/systemd/system/, + +
systemctl status libretime-playout
+
sudo systemctl restart libretime-playout +
+ echo 'check'; ?>"> "> - /etc/systemd/system/, - -
systemctl status libretime-liquidsoap
-
sudo systemctl restart libretime-liquidsoap - + } else { + ?>"> + /etc/systemd/system/, + +
systemctl status libretime-liquidsoap
+
sudo systemctl restart libretime-liquidsoap +
+ echo 'check'; ?>"> "> - /etc/systemd/system/, - -
systemctl status libretime-celery
-
sudo systemctl restart libretime-celery - + } else { + ?>"> + /etc/systemd/system/, + +
systemctl status libretime-celery
+
sudo systemctl restart libretime-celery +
+ echo 'check'; ?>"> "> - /etc/init.d/, - -
systemctl status libretime-api
-
sudo systemctl restart libretime-api - + } else { + ?>"> + /etc/init.d/, + +
systemctl status libretime-api
+
sudo systemctl restart libretime-api +
-
- + + +
+ diff --git a/legacy/application/configs/navigation.php b/legacy/application/configs/navigation.php index 274ccb9cc..d7db414c3 100644 --- a/legacy/application/configs/navigation.php +++ b/legacy/application/configs/navigation.php @@ -1,4 +1,5 @@ isset($track['track_title']) ? $track['track_title'] : '', + $elementMap = [ + 'element_title' => isset($track['track_title']) ? $track['track_title'] : '', 'element_artist' => isset($track['artist_name']) ? $track['artist_name'] : '', 'element_id' => isset($track['id']) ? $track['id'] : '', 'element_position' => isset($track['position']) ? $track['position'] : '', diff --git a/legacy/application/controllers/FeedsController.php b/legacy/application/controllers/FeedsController.php index 817946b35..e6b478934 100644 --- a/legacy/application/controllers/FeedsController.php +++ b/legacy/application/controllers/FeedsController.php @@ -12,7 +12,8 @@ class FeedsController extends Zend_Controller_Action if ((Application_Model_Preference::getStationPodcastPrivacy() && $request->getParam('sharing_token') != Application_Model_Preference::getStationPodcastDownloadKey()) - && !RestAuth::verifyAuth(true, false, $this)) { + && !RestAuth::verifyAuth(true, false, $this) + ) { $response->setHttpResponseCode(401); return; diff --git a/legacy/application/controllers/LocaleController.php b/legacy/application/controllers/LocaleController.php index a5bf895f2..4e3fffa92 100644 --- a/legacy/application/controllers/LocaleController.php +++ b/legacy/application/controllers/LocaleController.php @@ -12,9 +12,9 @@ final class LocaleController extends Zend_Controller_Action echo 'var datatables_dict =' . file_get_contents( Application_Common_OsPath::join( - // $_SERVER["DOCUMENT_ROOT"], - dirname(__FILE__) . '/../../public/', // Fixing this... -- Albert - 'js/datatables/i18n/', + // $_SERVER["DOCUMENT_ROOT"], + dirname(__FILE__) . '/../../public/', // Fixing this... -- Albert + 'js/datatables/i18n/', $locale . '.txt' ) ); diff --git a/legacy/application/controllers/PlaylistController.php b/legacy/application/controllers/PlaylistController.php index a7e925b25..49b04182a 100644 --- a/legacy/application/controllers/PlaylistController.php +++ b/legacy/application/controllers/PlaylistController.php @@ -221,9 +221,9 @@ class PlaylistController extends Zend_Controller_Action $type = $this->_getParam('type'); $objInfo = Application_Model_Library::getObjInfo($type); -// if (!is_null($id)) { + // if (!is_null($id)) { Application_Model_Library::changePlaylist($id, $type); -// } + // } try { $obj = new $objInfo['className']($id); diff --git a/legacy/application/controllers/ScheduleController.php b/legacy/application/controllers/ScheduleController.php index bc4da3e66..76fa1bc50 100644 --- a/legacy/application/controllers/ScheduleController.php +++ b/legacy/application/controllers/ScheduleController.php @@ -53,13 +53,13 @@ class ScheduleController extends Zend_Controller_Action $this->view->headScript()->appendScript( "var calendarPref = {};\n" . - 'calendarPref.weekStart = ' . Application_Model_Preference::GetWeekStartDay() . ";\n" . - 'calendarPref.timestamp = ' . time() . ";\n" . - 'calendarPref.timezoneOffset = ' . Application_Common_DateHelper::getUserTimezoneOffset() . ";\n" . - "calendarPref.timeScale = '" . Application_Model_Preference::GetCalendarTimeScale() . "';\n" . - 'calendarPref.timeInterval = ' . Application_Model_Preference::GetCalendarTimeInterval() . ";\n" . - 'calendarPref.weekStartDay = ' . Application_Model_Preference::GetWeekStartDay() . ";\n" . - "var calendarEvents = {$events};" + 'calendarPref.weekStart = ' . Application_Model_Preference::GetWeekStartDay() . ";\n" . + 'calendarPref.timestamp = ' . time() . ";\n" . + 'calendarPref.timezoneOffset = ' . Application_Common_DateHelper::getUserTimezoneOffset() . ";\n" . + "calendarPref.timeScale = '" . Application_Model_Preference::GetCalendarTimeScale() . "';\n" . + 'calendarPref.timeInterval = ' . Application_Model_Preference::GetCalendarTimeInterval() . ";\n" . + 'calendarPref.weekStartDay = ' . Application_Model_Preference::GetWeekStartDay() . ";\n" . + "var calendarEvents = {$events};" ); $this->view->headScript()->appendFile($baseUrl . 'js/contextmenu/jquery.contextMenu.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); @@ -731,8 +731,10 @@ class ScheduleController extends Zend_Controller_Action $baseUrl = $this->getRequest()->getBaseUrl(); $url = $file->getRelativeFileUrl($baseUrl) . 'download/true'; $menu = []; - $menu[] = ['action' => ['type' => 'gourl', 'url' => $url], - 'title' => _('Download'), ]; + $menu[] = [ + 'action' => ['type' => 'gourl', 'url' => $url], + 'title' => _('Download'), + ]; // returns format jjmenu is looking for. $this->_helper->json->sendJson($menu); diff --git a/legacy/application/controllers/ShowbuilderController.php b/legacy/application/controllers/ShowbuilderController.php index c91867a46..e3ccf6943 100644 --- a/legacy/application/controllers/ShowbuilderController.php +++ b/legacy/application/controllers/ShowbuilderController.php @@ -106,7 +106,7 @@ class ShowbuilderController extends Zend_Controller_Action $userService = new Application_Service_UserService(); $currentUser = $userService->getCurrentUser(); $previousPageWasLoginScreen = (strpos($previousPage, 'login') !== false) - || (strpos($previousPage, SAAS_LOGIN_REFERRER) !== false); + || (strpos($previousPage, SAAS_LOGIN_REFERRER) !== false); // If current user is Super Admin, and they came from the login page, // and they have not seen the setup popup before @@ -218,9 +218,11 @@ class ShowbuilderController extends Zend_Controller_Action [$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request); - $opts = ['myShows' => $my_shows, + $opts = [ + 'myShows' => $my_shows, 'showFilter' => $show_filter, - 'showInstanceFilter' => $show_instance_filter, ]; + 'showInstanceFilter' => $show_instance_filter, + ]; $showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts); $data = $showBuilder->getItems(); diff --git a/legacy/application/controllers/UserController.php b/legacy/application/controllers/UserController.php index 76d6f5500..efd3b0c26 100644 --- a/legacy/application/controllers/UserController.php +++ b/legacy/application/controllers/UserController.php @@ -133,8 +133,10 @@ class UserController extends Zend_Controller_Action if ($request->isPost()) { $formData = $request->getPost(); - if ($form->isValid($formData) - && $form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) { + if ( + $form->isValid($formData) + && $form->validateLogin($formData['cu_login'], $formData['cu_user_id']) + ) { $user = new Application_Model_User($formData['cu_user_id']); // Stupid hack because our schema enforces non-null first_name // even though by default the admin user has no first name... (....) @@ -154,8 +156,10 @@ class UserController extends Zend_Controller_Action // We don't allow 6 x's as a password. // The reason is because we use that as a password placeholder // on the client side. - if (array_key_exists('cu_password', $formData) && ($formData['cu_password'] != 'xxxxxx') - && (!empty($formData['cu_password']))) { + if ( + array_key_exists('cu_password', $formData) && ($formData['cu_password'] != 'xxxxxx') + && (!empty($formData['cu_password'])) + ) { $user->setPassword($formData['cu_password']); } diff --git a/legacy/application/controllers/plugins/Acl_plugin.php b/legacy/application/controllers/plugins/Acl_plugin.php index 72ba8196f..50e49a634 100644 --- a/legacy/application/controllers/plugins/Acl_plugin.php +++ b/legacy/application/controllers/plugins/Acl_plugin.php @@ -25,9 +25,11 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract */ public function __construct(Zend_Acl $aclData, $roleName = 'G') { - $this->_errorPage = ['module' => 'default', + $this->_errorPage = [ + 'module' => 'default', 'controller' => 'error', - 'action' => 'error', ]; + 'action' => 'error', + ]; $this->_roleName = $roleName; @@ -82,9 +84,11 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract */ public function setErrorPage($action, $controller = 'error', $module = 'default') { - $this->_errorPage = ['module' => $module, + $this->_errorPage = [ + 'module' => $module, 'controller' => $controller, - 'action' => $action, ]; + 'action' => $action, + ]; } /** diff --git a/legacy/application/controllers/plugins/PageLayoutInitPlugin.php b/legacy/application/controllers/plugins/PageLayoutInitPlugin.php index 2d3b85416..fa3ca36c9 100644 --- a/legacy/application/controllers/plugins/PageLayoutInitPlugin.php +++ b/legacy/application/controllers/plugins/PageLayoutInitPlugin.php @@ -36,8 +36,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract 'upgrade', 'embed', 'feeds', - ]) - ) { + ])) { // Start the session Zend_Session::start(); Application_Model_Auth::pinSessionToClient(Zend_Auth::getInstance()); diff --git a/legacy/application/forms/AddShowLiveStream.php b/legacy/application/forms/AddShowLiveStream.php index 81711a4f5..e4af19563 100644 --- a/legacy/application/forms/AddShowLiveStream.php +++ b/legacy/application/forms/AddShowLiveStream.php @@ -25,7 +25,8 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm ->setLabel(_('Custom Username')) ->setFilters(['StringTrim']) ->setValidators([ - new ConditionalNotEmpty(['cb_custom_auth' => '1']), ]); + new ConditionalNotEmpty(['cb_custom_auth' => '1']), + ]); $this->addElement($custom_username); // custom password @@ -37,7 +38,8 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm ->setLabel(_('Custom Password')) ->setFilters(['StringTrim']) ->setValidators([ - new ConditionalNotEmpty(['cb_custom_auth' => '1']), ]); + new ConditionalNotEmpty(['cb_custom_auth' => '1']), + ]); $this->addElement($custom_password); $showSourceParams = parse_url(Application_Model_Preference::GetLiveDJSourceConnectionURL()); diff --git a/legacy/application/forms/AddShowStyle.php b/legacy/application/forms/AddShowStyle.php index ca4bedadd..a7a4d4094 100644 --- a/legacy/application/forms/AddShowStyle.php +++ b/legacy/application/forms/AddShowStyle.php @@ -106,9 +106,11 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm { $elements = $this->getElements(); foreach ($elements as $element) { - if ($element->getType() != 'Zend_Form_Element_Hidden' + if ( + $element->getType() != 'Zend_Form_Element_Hidden' // We should still be able to remove the show logo - && $element->getName() != 'add_show_logo_current_remove') { + && $element->getName() != 'add_show_logo_current_remove' + ) { $element->setAttrib('disabled', 'disabled'); } } diff --git a/legacy/application/forms/AddShowWhen.php b/legacy/application/forms/AddShowWhen.php index 42ba81551..9aeb43e7f 100644 --- a/legacy/application/forms/AddShowWhen.php +++ b/legacy/application/forms/AddShowWhen.php @@ -37,7 +37,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm ->setFilters(['StringTrim']) ->setValidators([ $notEmptyValidator, - $dateValidator, ]) + $dateValidator, + ]) ->setDecorators(['ViewHelper']); $startDate->setAttrib('alt', 'date'); $this->addElement($startDate); @@ -64,7 +65,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm ->setFilters(['StringTrim']) ->setValidators([ $notEmptyValidator, - $dateValidator, ]) + $dateValidator, + ]) ->setDecorators(['ViewHelper']); $endDate->setAttrib('alt', 'date'); $this->addElement($endDate); @@ -77,7 +79,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm ->setFilters(['StringTrim']) ->setValidators([ $notEmptyValidator, - $regexValidator, ]) + $regexValidator, + ]) ->setDecorators(['ViewHelper']); $endTime->setAttrib('alt', 'time'); $this->addElement($endTime); @@ -173,10 +176,12 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm } elseif ($showStartDateTime == $showEndDateTime) { $this->getElement('add_show_duration')->setErrors([_('Cannot have duration 00h 00m')]); $valid = false; - } elseif (intval($duration->format('%d')) > 0 - && (intval($duration->format('%h')) > 0 - || intval($duration->format('%i')) > 0 - || intval($duration->format('%s')) > 0)) { + } elseif ( + intval($duration->format('%d')) > 0 + && (intval($duration->format('%h')) > 0 + || intval($duration->format('%i')) > 0 + || intval($duration->format('%s')) > 0) + ) { $this->getElement('add_show_duration')->setErrors([_('Cannot have duration greater than 24h')]); $valid = false; } diff --git a/legacy/application/forms/DateRange.php b/legacy/application/forms/DateRange.php index 67ae12330..447f1f470 100644 --- a/legacy/application/forms/DateRange.php +++ b/legacy/application/forms/DateRange.php @@ -17,7 +17,8 @@ class Application_Form_DateRange extends Zend_Form_SubForm ->setFilters(['StringTrim']) ->setValidators([ 'NotEmpty', - ['date', false, ['YYYY-MM-DD']], ]) + ['date', false, ['YYYY-MM-DD']], + ]) ->setDecorators(['ViewHelper']); $startDate->setAttrib('alt', 'date'); $this->addElement($startDate); @@ -31,7 +32,8 @@ class Application_Form_DateRange extends Zend_Form_SubForm ->setValidators([ 'NotEmpty', ['date', false, ['HH:mm']], - ['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ]) + ['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], + ]) ->setDecorators(['ViewHelper']); $startTime->setAttrib('alt', 'time'); $this->addElement($startTime); @@ -45,7 +47,8 @@ class Application_Form_DateRange extends Zend_Form_SubForm ->setFilters(['StringTrim']) ->setValidators([ 'NotEmpty', - ['date', false, ['YYYY-MM-DD']], ]) + ['date', false, ['YYYY-MM-DD']], + ]) ->setDecorators(['ViewHelper']); $endDate->setAttrib('alt', 'date'); $this->addElement($endDate); @@ -59,7 +62,8 @@ class Application_Form_DateRange extends Zend_Form_SubForm ->setValidators([ 'NotEmpty', ['date', false, ['HH:mm']], - ['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ]) + ['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], + ]) ->setDecorators(['ViewHelper']); $endTime->setAttrib('alt', 'time'); $this->addElement($endTime); diff --git a/legacy/application/forms/EditAudioMD.php b/legacy/application/forms/EditAudioMD.php index fbe4c8525..0d4e8957c 100644 --- a/legacy/application/forms/EditAudioMD.php +++ b/legacy/application/forms/EditAudioMD.php @@ -198,7 +198,8 @@ class Application_Form_EditAudioMD extends Zend_Form ->setFilters(['StringTrim']) ->setValidators([ new Zend_Validate_StringLength(['min' => 0, 'max' => 8]), - new Zend_Validate_Digits(), ]); + new Zend_Validate_Digits(), + ]); $this->addElement($bpm); // Add copyright field diff --git a/legacy/application/forms/EditUser.php b/legacy/application/forms/EditUser.php index 4d7d435dc..4a510cbc6 100644 --- a/legacy/application/forms/EditUser.php +++ b/legacy/application/forms/EditUser.php @@ -18,7 +18,8 @@ class Application_Form_EditUser extends Zend_Form $notDemoValidator = new Application_Validate_NotDemoValidate(); $this->setDecorators([ - ['ViewScript', ['viewScript' => 'form/edit-user.phtml', 'currentUser' => $currentUser->getLogin()]], ]); + ['ViewScript', ['viewScript' => 'form/edit-user.phtml', 'currentUser' => $currentUser->getLogin()]], + ]); $this->setAttrib('id', 'current-user-form'); $csrf_namespace = new Zend_Session_Namespace('csrf_namespace'); diff --git a/legacy/application/forms/GeneralPreferences.php b/legacy/application/forms/GeneralPreferences.php index 1ca5dceab..68d19406b 100644 --- a/legacy/application/forms/GeneralPreferences.php +++ b/legacy/application/forms/GeneralPreferences.php @@ -127,7 +127,8 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm $podcast_album_override->setValue(Application_Model_Preference::GetPodcastAlbumOverride()); $podcast_album_override->setDescription(_('Enabling this feature will cause podcast episode tracks to have their Artist, Title, and Album metatags set from podcast feed values. Note that enabling this feature is recommended in order to ensure reliable scheduling of episodes via smartblocks.')); $podcast_album_override->setSeparator(' '); // No
between radio buttons - $podcast_album_override->addDecorator('HtmlTag', ['tag' => 'dd', + $podcast_album_override->addDecorator('HtmlTag', [ + 'tag' => 'dd', 'id' => 'podcastAlbumOverride-element', 'class' => 'radio-inline-list', ]); @@ -142,7 +143,8 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm $podcast_auto_smartblock->setValue(Application_Model_Preference::GetPodcastAutoSmartblock()); $podcast_auto_smartblock->setDescription(_('If this option is enabled, a new smartblock and playlist matching the newest track of a podcast will be generated immediately upon creation of a new podcast. Note that the "Overwrite Podcast Episode Metatags" feature must also be enabled in order for smartblocks to reliably find episodes.')); $podcast_auto_smartblock->setSeparator(' '); // No
between radio buttons - $podcast_auto_smartblock->addDecorator('HtmlTag', ['tag' => 'dd', + $podcast_auto_smartblock->addDecorator('HtmlTag', [ + 'tag' => 'dd', 'id' => 'podcastAutoSmartblock-element', 'class' => 'radio-inline-list', ]); @@ -162,7 +164,8 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm to external widgets that can be embedded in your website.')); $third_party_api->setSeparator(' '); // No
between radio buttons // $third_party_api->addDecorator(new Zend_Form_Decorator_Label(array('tag' => 'dd', 'class' => 'radio-inline-list'))); - $third_party_api->addDecorator('HtmlTag', ['tag' => 'dd', + $third_party_api->addDecorator('HtmlTag', [ + 'tag' => 'dd', 'id' => 'thirdPartyApi-element', 'class' => 'radio-inline-list', ]); @@ -219,7 +222,8 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm $feature_preview_mode->setValue(Application_Model_Preference::GetFeaturePreviewMode()); $feature_preview_mode->setDescription(_('Enable this to opt-in to test new features.')); $feature_preview_mode->setSeparator(' '); // No
between radio buttons - $feature_preview_mode->addDecorator('HtmlTag', ['tag' => 'dd', + $feature_preview_mode->addDecorator('HtmlTag', [ + 'tag' => 'dd', 'id' => 'featurePreviewMode-element', 'class' => 'radio-inline-list', ]); diff --git a/legacy/application/forms/LiveStreamingPreferences.php b/legacy/application/forms/LiveStreamingPreferences.php index 6eea9aecf..69fe75178 100644 --- a/legacy/application/forms/LiveStreamingPreferences.php +++ b/legacy/application/forms/LiveStreamingPreferences.php @@ -29,8 +29,10 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm $transition_fade = new Zend_Form_Element_Text('transition_fade'); $transition_fade->setLabel(_('Switch Transition Fade (s):')) ->setFilters(['StringTrim']) - ->addValidator('regex', false, ['/^\d*(\.\d+)?$/', - 'messages' => _('Please enter a time in seconds (eg. 0.5)'), ]) + ->addValidator('regex', false, [ + '/^\d*(\.\d+)?$/', + 'messages' => _('Please enter a time in seconds (eg. 0.5)'), + ]) ->setValue($defaultFade); $this->addElement($transition_fade); @@ -85,7 +87,8 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm $masterSourceMount->setLabel(_('Master Source Mount:')) ->setValue($m_mount) ->setValidators([ - ['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]); + ['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], + ]); $this->addElement($masterSourceMount); $showSourceParams = parse_url(Application_Model_Preference::GetLiveDJSourceConnectionURL()); @@ -112,7 +115,8 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm $showSourceMount->setLabel(_('Show Source Mount:')) ->setValue($l_mount) ->setValidators([ - ['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]); + ['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], + ]); $this->addElement($showSourceMount); } @@ -126,7 +130,8 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm $this->setDecorators( [ - ['ViewScript', + [ + 'ViewScript', [ 'viewScript' => 'form/preferences_livestream.phtml', 'master_source_host' => isset($masterSourceHost) ? Application_Model_Preference::GetMasterDJSourceConnectionURL() : '', diff --git a/legacy/application/forms/Login.php b/legacy/application/forms/Login.php index b0969bc5b..d0b420f8c 100644 --- a/legacy/application/forms/Login.php +++ b/legacy/application/forms/Login.php @@ -40,7 +40,8 @@ class Application_Form_Login extends Zend_Form ->setAttribs([ 'autofocus' => 'true', 'class' => 'input_text', - 'required' => 'true', ]) + 'required' => 'true', + ]) ->setValue((isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) ? 'admin' : '') ->addFilter('StringTrim') ->setDecorators(['ViewHelper']) diff --git a/legacy/application/forms/PasswordChange.php b/legacy/application/forms/PasswordChange.php index 6112ef2ad..a75f9024b 100644 --- a/legacy/application/forms/PasswordChange.php +++ b/legacy/application/forms/PasswordChange.php @@ -15,8 +15,10 @@ class Application_Form_PasswordChange extends Zend_Form 'label' => _('Password'), 'required' => true, 'filters' => ['stringTrim'], - 'validators' => [$notEmptyValidator, - $stringLengthValidator, ], + 'validators' => [ + $notEmptyValidator, + $stringLengthValidator, + ], 'decorators' => [ 'ViewHelper', ], diff --git a/legacy/application/forms/PodcastPreferences.php b/legacy/application/forms/PodcastPreferences.php index 01e7a73b8..8c2829de9 100644 --- a/legacy/application/forms/PodcastPreferences.php +++ b/legacy/application/forms/PodcastPreferences.php @@ -12,7 +12,8 @@ class Application_Form_PodcastPreferences extends Zend_Form_SubForm _('Private'), ]); $stationPodcastPrivacy->setSeparator(' '); - $stationPodcastPrivacy->addDecorator('HtmlTag', ['tag' => 'dd', + $stationPodcastPrivacy->addDecorator('HtmlTag', [ + 'tag' => 'dd', 'id' => 'stationPodcastPrivacy-element', 'class' => 'radio-inline-list', ]); diff --git a/legacy/application/forms/SetupLanguageTimezone.php b/legacy/application/forms/SetupLanguageTimezone.php index 82151ba95..c0dbc921e 100644 --- a/legacy/application/forms/SetupLanguageTimezone.php +++ b/legacy/application/forms/SetupLanguageTimezone.php @@ -5,7 +5,8 @@ class Application_Form_SetupLanguageTimezone extends Zend_Form_SubForm public function init() { $this->setDecorators([ - ['ViewScript', ['viewScript' => 'form/setup-lang-timezone.phtml']], ]); + ['ViewScript', ['viewScript' => 'form/setup-lang-timezone.phtml']], + ]); $csrf_namespace = new Zend_Session_Namespace('csrf_namespace'); $csrf_element = new Zend_Form_Element_Hidden('csrf'); diff --git a/legacy/application/forms/ShowBuilder.php b/legacy/application/forms/ShowBuilder.php index 73a5e4c1d..28d2d1448 100644 --- a/legacy/application/forms/ShowBuilder.php +++ b/legacy/application/forms/ShowBuilder.php @@ -19,7 +19,8 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm ->setFilters(['StringTrim']) ->setValidators([ 'NotEmpty', - ['date', false, ['YYYY-MM-DD']], ]) + ['date', false, ['YYYY-MM-DD']], + ]) ->setDecorators(['ViewHelper']); $startDate->setAttrib('alt', 'date'); $this->addElement($startDate); @@ -33,7 +34,8 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm ->setValidators([ 'NotEmpty', ['date', false, ['HH:mm']], - ['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ]) + ['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], + ]) ->setDecorators(['ViewHelper']); $startTime->setAttrib('alt', 'time'); $this->addElement($startTime); @@ -47,7 +49,8 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm ->setFilters(['StringTrim']) ->setValidators([ 'NotEmpty', - ['date', false, ['YYYY-MM-DD']], ]) + ['date', false, ['YYYY-MM-DD']], + ]) ->setDecorators(['ViewHelper']); $endDate->setAttrib('alt', 'date'); $this->addElement($endDate); @@ -61,7 +64,8 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm ->setValidators([ 'NotEmpty', ['date', false, ['HH:mm']], - ['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ]) + ['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], + ]) ->setDecorators(['ViewHelper']); $endTime->setAttrib('alt', 'time'); $this->addElement($endTime); diff --git a/legacy/application/forms/ShowListenerStat.php b/legacy/application/forms/ShowListenerStat.php index e28f453b1..aa76fb728 100644 --- a/legacy/application/forms/ShowListenerStat.php +++ b/legacy/application/forms/ShowListenerStat.php @@ -17,7 +17,8 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm ->setFilters(['StringTrim']) ->setValidators([ 'NotEmpty', - ['date', false, ['YYYY-MM-DD']], ]) + ['date', false, ['YYYY-MM-DD']], + ]) ->setDecorators(['ViewHelper']); $startDate->setAttrib('alt', 'date'); $this->addElement($startDate); @@ -31,7 +32,8 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm ->setValidators([ 'NotEmpty', ['date', false, ['HH:mm']], - ['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ]) + ['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], + ]) ->setDecorators(['ViewHelper']); $startTime->setAttrib('alt', 'time'); $this->addElement($startTime); @@ -45,7 +47,8 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm ->setFilters(['StringTrim']) ->setValidators([ 'NotEmpty', - ['date', false, ['YYYY-MM-DD']], ]) + ['date', false, ['YYYY-MM-DD']], + ]) ->setDecorators(['ViewHelper']); $endDate->setAttrib('alt', 'date'); $this->addElement($endDate); @@ -59,7 +62,8 @@ class Application_Form_ShowListenerStat extends Zend_Form_SubForm ->setValidators([ 'NotEmpty', ['date', false, ['HH:mm']], - ['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], ]) + ['regex', false, ['/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => _('Invalid character entered')]], + ]) ->setDecorators(['ViewHelper']); $endTime->setAttrib('alt', 'time'); $this->addElement($endTime); diff --git a/legacy/application/forms/SmartBlockCriteria.php b/legacy/application/forms/SmartBlockCriteria.php index 63a0e0306..415ce031d 100644 --- a/legacy/application/forms/SmartBlockCriteria.php +++ b/legacy/application/forms/SmartBlockCriteria.php @@ -235,7 +235,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm Application_Common_DateHelper::UTCStringToUserTimezoneString($constraint['value']); if (isset($constraint['extra'])) { $constraint['extra'] = - Application_Common_DateHelper::UTCStringToUserTimezoneString($constraint['extra']); + Application_Common_DateHelper::UTCStringToUserTimezoneString($constraint['extra']); } } } @@ -382,8 +382,10 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm // The challenge here is that datetime if (isset($criteriaKeys[$i])) { $modifierTest = (string) $storedCrit['crit'][$criteriaKeys[$i]][$j]['modifier']; - if (isset($criteriaType) && $criteriaType == 'tt' - && preg_match('/is|is not/', $modifierTest) == 1) { + if ( + isset($criteriaType) && $criteriaType == 'tt' + && preg_match('/is|is not/', $modifierTest) == 1 + ) { $criteriaValue = new Zend_Form_Element_Select('sp_criteria_value_' . $i . '_' . $j); $criteriaValue->setAttrib('class', 'input_select sp_input_select')->setDecorators(['viewHelper']); @@ -411,13 +413,17 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm // this is used below to test whether the datetime select should be shown or hidden $relativeDateTime = false; $modifierTest = (string) $storedCrit['crit'][$criteriaKeys[$i]][$j]['modifier']; - if (isset($criteriaType) && $criteriaType == 'd' - && preg_match('/before|after|between/', $modifierTest) == 1) { + if ( + isset($criteriaType) && $criteriaType == 'd' + && preg_match('/before|after|between/', $modifierTest) == 1 + ) { // set relativeDatetime boolean to true so that the datetime select is displayed below $relativeDateTime = true; $criteriaValue->setValue(filter_var($storedCrit['crit'][$criteriaKeys[$i]][$j]['value'], FILTER_SANITIZE_NUMBER_INT)); - } elseif (isset($criteriaType) && $criteriaType == 'tt' - && preg_match('/is|is not/', $modifierTest) == 1) { + } elseif ( + isset($criteriaType) && $criteriaType == 'tt' + && preg_match('/is|is not/', $modifierTest) == 1 + ) { // set relativeDatetime boolean to true so that the datetime select is displayed below $relativeDateTime = false; @@ -449,9 +455,11 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm $criteriaDatetimeSelect->setAttrib('disabled', 'disabled'); } // check if the value is stored and it is a relative datetime field - if (isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['value'], $criteriaType) - && $criteriaType == 'd' - && preg_match('/before|after|between/', $modifierTest) == 1) { + if ( + isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['value'], $criteriaType) + && $criteriaType == 'd' + && preg_match('/before|after|between/', $modifierTest) == 1 + ) { // need to remove any leading numbers stored in the database $dateTimeSelectValue = preg_replace('/[0-9]+/', '', $storedCrit['crit'][$criteriaKeys[$i]][$j]['value']); // need to strip white from front and ago from the end to match with the value of the time unit select dropdown @@ -489,8 +497,10 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm $criteriaExtraDatetimeSelect->setAttrib('class', 'input_select sp_input_select') ->setDecorators(['viewHelper']); - if (isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra']) - && $modifierTest == 'between') { + if ( + isset($criteriaKeys[$i], $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra']) + && $modifierTest == 'between' + ) { // need to remove the leading numbers stored in the database $extraDateTimeSelectValue = preg_replace('/[0-9]+/', '', $storedCrit['crit'][$criteriaKeys[$i]][$j]['extra']); // need to strip white from front and ago from the end to match with the value of the time unit select dropdown @@ -505,8 +515,8 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm $criteriaExtraDatetimeSelect->setAttrib('disabled', 'disabled'); } $this->addElement($criteriaExtraDatetimeSelect); - }// for - }// for + } // for + } // for $repeatTracks = new Zend_Form_Element_Checkbox('sp_repeat_tracks'); $repeatTracks->setDecorators(['viewHelper']) @@ -576,8 +586,10 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm $this->addElement($shuffle); $this->setDecorators([ - ['ViewScript', ['viewScript' => 'form/smart-block-criteria.phtml', 'openOption' => $openSmartBlockOption, - 'criteriasLength' => $numElements, 'modRowMap' => $modRowMap, ]], + ['ViewScript', [ + 'viewScript' => 'form/smart-block-criteria.phtml', 'openOption' => $openSmartBlockOption, + 'criteriasLength' => $numElements, 'modRowMap' => $modRowMap, + ]], ]); } @@ -889,8 +901,10 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm } } } - } elseif ($column->getType() == PropelColumnTypes::INTEGER - && $d['sp_criteria_field'] != 'owner_id') { + } elseif ( + $column->getType() == PropelColumnTypes::INTEGER + && $d['sp_criteria_field'] != 'owner_id' + ) { if (!is_numeric($d['sp_criteria_value'])) { $element->addError(_('The value has to be numeric')); $isValid = false; @@ -912,9 +926,9 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm $element->addError(_('Value cannot be empty')); $isValid = false; } - }// end foreach - }// for loop - }// if + } // end foreach + } // for loop + } // if return $isValid; } diff --git a/legacy/application/forms/StreamSettingSubForm.php b/legacy/application/forms/StreamSettingSubForm.php index 570eca1d1..15aeb86a5 100644 --- a/legacy/application/forms/StreamSettingSubForm.php +++ b/legacy/application/forms/StreamSettingSubForm.php @@ -81,8 +81,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm $output = new Zend_Form_Element_Select('output'); $output->setLabel(_('Service Type:')) ->setMultiOptions(['icecast' => 'Icecast', 'shoutcast' => 'SHOUTcast']) - ->setValue($useDefaults ? $streamDefaults['output'] : - (isset($setting[$prefix . '_output']) ? $setting[$prefix . '_output'] : 'icecast')) + ->setValue($useDefaults ? $streamDefaults['output'] : (isset($setting[$prefix . '_output']) ? $setting[$prefix . '_output'] : 'icecast')) ->setDecorators(['ViewHelper']); $this->addElement($output); @@ -96,18 +95,17 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm $host = new Zend_Form_Element_Text('host'); $host->setLabel(_('Server')) - ->setValue($useDefaults ? $streamDefaults['host'] : - (isset($setting[$prefix . '_host']) ? $setting[$prefix . '_host'] : '')) + ->setValue($useDefaults ? $streamDefaults['host'] : (isset($setting[$prefix . '_host']) ? $setting[$prefix . '_host'] : '')) ->setValidators([ - ['regex', false, ['/^[0-9a-zA-Z-_.]+$/', 'messages' => _('Invalid character entered')]], ]) + ['regex', false, ['/^[0-9a-zA-Z-_.]+$/', 'messages' => _('Invalid character entered')]], + ]) ->setDecorators(['ViewHelper']); $host->setAttrib('alt', 'domain'); $this->addElement($host); $port = new Zend_Form_Element_Text('port'); $port->setLabel(_('Port')) - ->setValue($useDefaults ? $streamDefaults['port'] : - (isset($setting[$prefix . '_port']) ? $setting[$prefix . '_port'] : '')) + ->setValue($useDefaults ? $streamDefaults['port'] : (isset($setting[$prefix . '_port']) ? $setting[$prefix . '_port'] : '')) ->setValidators([new Zend_Validate_Between(['min' => 0, 'max' => 99999])]) ->addValidator('regex', false, ['pattern' => '/^[0-9]+$/', 'messages' => ['regexNotMatch' => _('Only numbers are allowed.')]]) ->setDecorators(['ViewHelper']); @@ -115,10 +113,10 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm $pass = new Zend_Form_Element_Text('pass'); $pass->setLabel(_('Password')) - ->setValue($useDefaults ? $streamDefaults['pass'] : - (isset($setting[$prefix . '_pass']) ? $setting[$prefix . '_pass'] : '')) + ->setValue($useDefaults ? $streamDefaults['pass'] : (isset($setting[$prefix . '_pass']) ? $setting[$prefix . '_pass'] : '')) ->setValidators([ - ['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]) + ['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], + ]) ->setDecorators(['ViewHelper']); $pass->setAttrib('alt', 'regular_text'); $this->addElement($pass); @@ -133,7 +131,8 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm $url->setLabel(_('URL')) ->setValue(isset($setting[$prefix . '_url']) ? $setting[$prefix . '_url'] : '') ->setValidators([ - ['regex', false, ['/^[0-9a-zA-Z\-_.:\/]+$/', 'messages' => _('Invalid character entered')]], ]) + ['regex', false, ['/^[0-9a-zA-Z\-_.:\/]+$/', 'messages' => _('Invalid character entered')]], + ]) ->setDecorators(['ViewHelper']); $url->setAttrib('alt', 'url'); $this->addElement($url); @@ -152,20 +151,20 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm $mount = new Zend_Form_Element_Text('mount'); $mount->setLabel(_('Mount Point')) - ->setValue($useDefaults ? $streamDefaults['mount'] : - (isset($setting[$prefix . '_mount']) ? $setting[$prefix . '_mount'] : '')) + ->setValue($useDefaults ? $streamDefaults['mount'] : (isset($setting[$prefix . '_mount']) ? $setting[$prefix . '_mount'] : '')) ->setValidators([ - ['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]) + ['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], + ]) ->setDecorators(['ViewHelper']); $mount->setAttrib('alt', 'regular_text'); $this->addElement($mount); $user = new Zend_Form_Element_Text('user'); $user->setLabel(_('Username')) - ->setValue($useDefaults ? $streamDefaults['user'] : - (isset($setting[$prefix . '_user']) ? $setting[$prefix . '_user'] : '')) + ->setValue($useDefaults ? $streamDefaults['user'] : (isset($setting[$prefix . '_user']) ? $setting[$prefix . '_user'] : '')) ->setValidators([ - ['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]) + ['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], + ]) ->setDecorators(['ViewHelper']); $user->setAttrib('alt', 'regular_text'); $this->addElement($user); @@ -174,7 +173,8 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm $adminUser->setLabel(_('Admin User')) ->setValue(Application_Model_StreamSetting::getAdminUser($prefix)) ->setValidators([ - ['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]) + ['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], + ]) ->setDecorators(['ViewHelper']); $adminUser->setAttrib('alt', 'regular_text'); $this->addElement($adminUser); @@ -183,7 +183,8 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm $adminPass->setLabel(_('Admin Password')) ->setValue(Application_Model_StreamSetting::getAdminPass($prefix)) ->setValidators([ - ['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], ]) + ['regex', false, ['/^[^ &<>]+$/', 'messages' => _('Invalid character entered')]], + ]) ->setDecorators(['ViewHelper']); $adminPass->setAttrib('alt', 'regular_text'); $this->addElement($adminPass); @@ -191,10 +192,12 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm $liquidsoap_error_msg = '

' . _('Getting information from the server...') . '

'; $this->setDecorators([ - ['ViewScript', ['viewScript' => 'form/stream-setting-form.phtml', + ['ViewScript', [ + 'viewScript' => 'form/stream-setting-form.phtml', 'stream_number' => $stream_number, 'enabled' => $enable->getValue(), - 'liquidsoap_error_msg' => $liquidsoap_error_msg, ]], + 'liquidsoap_error_msg' => $liquidsoap_error_msg, + ]], ]); } @@ -236,7 +239,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm if (Application_Model_Preference::getUsingCustomStreamSettings()) { $element->setAttrib('disabled', null); } elseif (!(in_array($element->getName(), static::$customizable) - || $element->getType() == 'Zend_Form_Element_Hidden')) { + || $element->getType() == 'Zend_Form_Element_Hidden')) { $element->setAttrib('disabled', 'disabled'); } } diff --git a/legacy/application/forms/customfilters/ImageSize.php b/legacy/application/forms/customfilters/ImageSize.php index 52a8a3f15..7e4151728 100644 --- a/legacy/application/forms/customfilters/ImageSize.php +++ b/legacy/application/forms/customfilters/ImageSize.php @@ -1,4 +1,5 @@ Criteria::CUSTOM, 'before' => Criteria::CUSTOM, 'after' => Criteria::CUSTOM, - 'between' => Criteria::CUSTOM, ]; + 'between' => Criteria::CUSTOM, + ]; private static $criteria2PeerMap = [ 0 => 'Select criteria', @@ -978,8 +979,10 @@ SQL; throw $e; } - return ['cliplength' => $cliplength, 'cueIn' => $cueIn, 'cueOut' => $cueOut, 'length' => $this->getUnformatedLength(), - 'fadeIn' => $fadeIn, 'fadeOut' => $fadeOut, ]; + return [ + 'cliplength' => $cliplength, 'cueIn' => $cueIn, 'cueOut' => $cueOut, 'length' => $this->getUnformatedLength(), + 'fadeIn' => $fadeIn, 'fadeOut' => $fadeOut, + ]; } public function getAllPLMetaData() @@ -1487,7 +1490,8 @@ SQL; $storedCrit['limit'] = [ 'value' => $value, 'modifier' => $modifier, - 'display_modifier' => _($modifier), ]; + 'display_modifier' => _($modifier), + ]; } elseif ($criteria == 'repeat_tracks') { $storedCrit['repeat_tracks'] = ['value' => $value]; } elseif ($criteria == 'overflow_tracks') { @@ -1502,7 +1506,8 @@ SQL; 'extra' => $extra, 'criteria_group' => $criteriagroup, 'display_name' => $criteriaOptions[$criteria], - 'display_modifier' => $modifierOptions[$modifier], ]; + 'display_modifier' => $modifierOptions[$modifier], + ]; } } @@ -1583,7 +1588,8 @@ SQL; $storedCrit['limit'] = [ 'value' => $value, 'modifier' => $modifier, - 'display_modifier' => _($modifier), ]; + 'display_modifier' => _($modifier), + ]; } elseif ($criteria == 'repeat_tracks') { $storedCrit['repeat_tracks'] = ['value' => $value]; } elseif ($criteria == 'overflow_tracks') { @@ -1597,7 +1603,8 @@ SQL; 'modifier' => $modifier, 'extra' => $extra, 'display_name' => $criteriaOptions[$criteria], - 'display_modifier' => $modifierOptions[$modifier], ]; + 'display_modifier' => $modifierOptions[$modifier], + ]; } } diff --git a/legacy/application/models/Dashboard.php b/legacy/application/models/Dashboard.php index a46295218..9fc0001fd 100644 --- a/legacy/application/models/Dashboard.php +++ b/legacy/application/models/Dashboard.php @@ -17,30 +17,38 @@ class Application_Model_Dashboard return null; } - return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'], + return [ + 'name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'], 'starts' => $row[0]['starts'], - 'ends' => $row[0]['ends'], ]; + 'ends' => $row[0]['ends'], + ]; } if (count($row) == 0) { if ($showInstance->isRecorded()) { // last item is a show instance - return ['name' => $showInstance->getName(), + return [ + 'name' => $showInstance->getName(), 'starts' => $showInstance->getShowInstanceStart(), - 'ends' => $showInstance->getShowInstanceEnd(), ]; + 'ends' => $showInstance->getShowInstanceEnd(), + ]; } return null; } // return the one that started later. if ($row[0]['starts'] >= $showInstance->getShowInstanceStart()) { - return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'], + return [ + 'name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'], 'starts' => $row[0]['starts'], - 'ends' => $row[0]['ends'], ]; + 'ends' => $row[0]['ends'], + ]; } - return ['name' => $showInstance->getName(), + return [ + 'name' => $showInstance->getName(), 'starts' => $showInstance->getShowInstanceStart(), - 'ends' => $showInstance->getShowInstanceEnd(), ]; + 'ends' => $showInstance->getShowInstanceEnd(), + ]; } public static function GetCurrentItem($p_timeNow) @@ -65,30 +73,36 @@ class Application_Model_Dashboard * in the future. */ - return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'], + return [ + 'name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'], 'artwork_data' => $row[0]['artwork_data'], 'starts' => $row[0]['starts'], - 'ends' => $row[0]['ends'], ]; + 'ends' => $row[0]['ends'], + ]; } if (count($row) == 0) { // last item is a show instance if ($showInstance->isRecorded()) { - return ['name' => $showInstance->getName(), + return [ + 'name' => $showInstance->getName(), 'starts' => $showInstance->getShowInstanceStart(), 'ends' => $showInstance->getShowInstanceEnd(), 'media_item_played' => false, - 'record' => true, ]; + 'record' => true, + ]; } return null; } - return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'], + return [ + 'name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'], 'artwork_data' => $row[0]['artwork_data'], 'starts' => $row[0]['starts'], 'ends' => $row[0]['ends'], 'media_item_played' => $row[0]['media_item_played'], - 'record' => 0, ]; + 'record' => 0, + ]; } public static function GetNextItem($p_timeNow) @@ -106,17 +120,21 @@ class Application_Model_Dashboard return null; } - return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'], + return [ + 'name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'], 'artwork_data' => $row[0]['artwork_data'], 'starts' => $row[0]['starts'], - 'ends' => $row[0]['ends'], ]; + 'ends' => $row[0]['ends'], + ]; } if (count($row) == 0) { if ($showInstance->isRecorded()) { // last item is a show instance - return ['name' => $showInstance->getName(), + return [ + 'name' => $showInstance->getName(), 'starts' => $showInstance->getShowInstanceStart(), - 'ends' => $showInstance->getShowInstanceEnd(), ]; + 'ends' => $showInstance->getShowInstanceEnd(), + ]; } return null; @@ -124,14 +142,18 @@ class Application_Model_Dashboard // return the one that starts sooner. if ($row[0]['starts'] <= $showInstance->getShowInstanceStart()) { - return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'], + return [ + 'name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'], 'artwork_data' => $row[0]['artwork_data'], 'starts' => $row[0]['starts'], - 'ends' => $row[0]['ends'], ]; + 'ends' => $row[0]['ends'], + ]; } - return ['name' => $showInstance->getName(), + return [ + 'name' => $showInstance->getName(), 'starts' => $showInstance->getShowInstanceStart(), - 'ends' => $showInstance->getShowInstanceEnd(), ]; + 'ends' => $showInstance->getShowInstanceEnd(), + ]; } } diff --git a/legacy/application/models/Datatables.php b/legacy/application/models/Datatables.php index 1d75913bb..bdd8d15b9 100644 --- a/legacy/application/models/Datatables.php +++ b/legacy/application/models/Datatables.php @@ -105,7 +105,8 @@ class Application_Model_Datatables $debug = [ '$new_index' => $new_index, '$currentPos' => $currentPos, - '$orig2searchTerm' => $orig2searchTerm, ]; + '$orig2searchTerm' => $orig2searchTerm, + ]; Logging::warn($debug); } } diff --git a/legacy/application/models/ListenerStat.php b/legacy/application/models/ListenerStat.php index 579ee4f18..090affdcd 100644 --- a/legacy/application/models/ListenerStat.php +++ b/legacy/application/models/ListenerStat.php @@ -63,7 +63,7 @@ SQL; foreach ($enabledStreamIds as $sId) { $sql = 'SELECT value FROM cc_stream_setting' - . ' WHERE keyname = :key'; + . ' WHERE keyname = :key'; $result = Application_Common_Database::prepareAndExecute($sql, ['key' => $sId . '_mount'], 'single'); @@ -120,8 +120,10 @@ SQL; // tricking javascript so it thinks the server timezone is in UTC $average_listeners = array_sum(array_column($data, 'listeners')) / count($data); $max_num_listeners = max(array_column($data, 'listeners')); - $entry = ['show' => $showName, 'time' => $t->format('Y-m-d H:i:s'), 'average_number_of_listeners' => $average_listeners, - 'maximum_number_of_listeners' => $max_num_listeners, ]; + $entry = [ + 'show' => $showName, 'time' => $t->format('Y-m-d H:i:s'), 'average_number_of_listeners' => $average_listeners, + 'maximum_number_of_listeners' => $max_num_listeners, + ]; array_push($showData, $entry); } } @@ -195,7 +197,8 @@ SQL; Application_Common_Database::prepareAndExecute( $stats_sql, - ['timestamp_id' => $timestamp_id, + [ + 'timestamp_id' => $timestamp_id, 'listener_count' => $dp['num_listeners'], 'mount_name_id' => $mount_name_id, ] diff --git a/legacy/application/models/LiveLog.php b/legacy/application/models/LiveLog.php index 56f196fae..9b202c8e8 100644 --- a/legacy/application/models/LiveLog.php +++ b/legacy/application/models/LiveLog.php @@ -6,9 +6,9 @@ class Application_Model_LiveLog { try { $sql = 'SELECT * FROM CC_LIVE_LOG' - . ' WHERE state = :state' - . " and (start_time >= (now() - INTERVAL '1 day'))" - . ' ORDER BY id'; + . ' WHERE state = :state' + . " and (start_time >= (now() - INTERVAL '1 day'))" + . ' ORDER BY id'; $rows = Application_Common_Database::prepareAndExecute( $sql, [':state' => 'L'], @@ -37,7 +37,7 @@ class Application_Model_LiveLog array_push($rows, $last_row); foreach ($rows as $row) { $sql_delete = 'DELETE FROM CC_LIVE_LOG' - . ' WHERE id = :id'; + . ' WHERE id = :id'; Application_Common_Database::prepareAndExecute( $sql_delete, [':id' => $row['id']], @@ -88,7 +88,7 @@ class Application_Model_LiveLog if (!$p_keepData) { // Delete data we just used to start a new log history $sql_delete = 'DELETE FROM CC_LIVE_LOG' - . ' WHERE id = :id'; + . ' WHERE id = :id'; Application_Common_Database::prepareAndExecute( $sql_delete, [':id' => $row['id']], @@ -118,9 +118,9 @@ class Application_Model_LiveLog { try { $sql_get_logs = 'SELECT * FROM CC_LIVE_LOG' - . ' WHERE state = :state' - . " and (start_time >= (now() - INTERVAL '1 day'))" - . ' ORDER BY id'; + . ' WHERE state = :state' + . " and (start_time >= (now() - INTERVAL '1 day'))" + . ' ORDER BY id'; $rows = Application_Common_Database::prepareAndExecute( $sql_get_logs, @@ -150,7 +150,7 @@ class Application_Model_LiveLog array_push($rows, $last_row); foreach ($rows as $row) { $sql_delete = 'DELETE FROM CC_LIVE_LOG' - . ' WHERE id = :id'; + . ' WHERE id = :id'; Application_Common_Database::prepareAndExecute( $sql_delete, [':id' => $row['id']], @@ -171,10 +171,10 @@ class Application_Model_LiveLog */ foreach ($rows as $row) { $sql_get_tracks = 'SELECT * FROM cc_schedule' - . ' WHERE starts >= :starts1' - . ' AND starts < :starts2' - . ' AND file_id IS NOT NULL' - . ' AND media_item_played IS TRUE'; + . ' WHERE starts >= :starts1' + . ' AND starts < :starts2' + . ' AND file_id IS NOT NULL' + . ' AND media_item_played IS TRUE'; $params = [ ':starts1' => $row['start_time'], ':starts2' => $row['end_time'], @@ -269,7 +269,7 @@ class Application_Model_LiveLog if (!$p_keepData) { // Delete row because we do not need data anymore $sql_delete = 'DELETE FROM CC_LIVE_LOG' - . ' WHERE id = :id'; + . ' WHERE id = :id'; Application_Common_Database::prepareAndExecute( $sql_delete, [':id' => $row['id']], @@ -320,7 +320,7 @@ class Application_Model_LiveLog * has ended */ $sql_select = 'SELECT max(id) from CC_LIVE_LOG' - . ' WHERE (state= :state1 and end_time is NULL) or (state= :state2 and end_time is NULL)'; + . ' WHERE (state= :state1 and end_time is NULL) or (state= :state2 and end_time is NULL)'; $params = [ ':state1' => 'L', ':state2' => 'S', @@ -333,7 +333,7 @@ class Application_Model_LiveLog if ($id == null) { $sql_insert = 'INSERT INTO CC_LIVE_LOG (state, start_time)' - . ' VALUES (:state, :start)'; + . ' VALUES (:state, :start)'; $params = [ ':state' => $state, ':start' => $dateTime->format(DEFAULT_TIMESTAMP_FORMAT), @@ -364,7 +364,7 @@ class Application_Model_LiveLog if (($dj_live == 'off' && $master_live == 'off') || $state == 'S' || $override) { $sql = 'SELECT id, state from cc_live_log' - . ' where id in (select max(id) from cc_live_log)'; + . ' where id in (select max(id) from cc_live_log)'; $row = Application_Common_Database::prepareAndExecute( $sql, [], @@ -376,8 +376,8 @@ class Application_Model_LiveLog */ if ($row['state'] == $state) { $update_sql = 'UPDATE CC_LIVE_LOG' - . ' SET end_time = :end' - . ' WHERE id = :id'; + . ' SET end_time = :end' + . ' WHERE id = :id'; $params = [ ':end' => $dateTime->format(DEFAULT_TIMESTAMP_FORMAT), ':id' => $row['id'], diff --git a/legacy/application/models/Playlist.php b/legacy/application/models/Playlist.php index 217473541..d861302d1 100644 --- a/legacy/application/models/Playlist.php +++ b/legacy/application/models/Playlist.php @@ -230,7 +230,8 @@ SQL; // Logging::info($sql); $params = [ - ':playlist_id1' => $this->id, ':playlist_id2' => $this->id, ':playlist_id3' => $this->id, ]; + ':playlist_id1' => $this->id, ':playlist_id2' => $this->id, ':playlist_id3' => $this->id, + ]; if ($filterFiles) { $params[':file_exists'] = $filterFiles; } @@ -401,7 +402,8 @@ SQL; if (isset($obj)) { if (($obj instanceof CcFiles && $obj->visible()) || $obj instanceof CcWebstream - || $obj instanceof CcBlock) { + || $obj instanceof CcBlock + ) { $entry = $this->plItem; $entry['id'] = $obj->getDbId(); $entry['pos'] = $pos; @@ -409,19 +411,19 @@ SQL; if ($obj instanceof CcFiles && $obj) { $entry['cuein'] = isset($p_item['cuein']) ? - $p_item['cuein'] : $obj->getDbCuein(); + $p_item['cuein'] : $obj->getDbCuein(); $entry['cueout'] = isset($p_item['cueout']) ? - $p_item['cueout'] : $obj->getDbCueout(); + $p_item['cueout'] : $obj->getDbCueout(); $cue_in = isset($p_item['cueInSec']) ? - $p_item['cueInSec'] : Application_Common_DateHelper::calculateLengthInSeconds($entry['cuein']); + $p_item['cueInSec'] : Application_Common_DateHelper::calculateLengthInSeconds($entry['cuein']); $cue_out = isset($p_item['cueOutSec']) ? - $p_item['cueOutSec'] : Application_Common_DateHelper::calculateLengthInSeconds($entry['cueout']); + $p_item['cueOutSec'] : Application_Common_DateHelper::calculateLengthInSeconds($entry['cueout']); $entry['cliplength'] = isset($p_item['length']) ? - $p_item['length'] : Application_Common_DateHelper::secondsToPlaylistTime($cue_out - $cue_in); + $p_item['length'] : Application_Common_DateHelper::secondsToPlaylistTime($cue_out - $cue_in); } elseif ($obj instanceof CcWebstream && $obj) { $entry['cuein'] = '00:00:00'; $entry['cueout'] = $entry['cliplength']; @@ -914,8 +916,10 @@ SQL; throw $e; } - return ['cliplength' => $cliplength, 'cueIn' => $cueIn, 'cueOut' => $cueOut, 'length' => $this->getLength(), - 'fadeIn' => $fadeIn, 'fadeOut' => $fadeOut, ]; + return [ + 'cliplength' => $cliplength, 'cueIn' => $cueIn, 'cueOut' => $cueOut, 'length' => $this->getLength(), + 'fadeIn' => $fadeIn, 'fadeOut' => $fadeOut, + ]; } public function getAllPLMetaData() diff --git a/legacy/application/models/Preference.php b/legacy/application/models/Preference.php index a646b6e53..85e1a8481 100644 --- a/legacy/application/models/Preference.php +++ b/legacy/application/models/Preference.php @@ -157,7 +157,7 @@ class Application_Model_Preference // Check if key already exists $sql = 'SELECT COUNT(*) FROM cc_pref' - . ' WHERE keystr = :key'; + . ' WHERE keystr = :key'; $paramMap = []; $paramMap[':key'] = $key; @@ -177,7 +177,7 @@ class Application_Model_Preference $res = ''; } else { $sql = 'SELECT valstr FROM cc_pref' - . ' WHERE keystr = :key'; + . ' WHERE keystr = :key'; $paramMap = []; $paramMap[':key'] = $key; @@ -667,10 +667,12 @@ class Application_Model_Preference if (isset($info[1])) { $key = str_replace(' ', '_', trim($info[0])); $key = strtoupper($key); - if ($key == 'WEB_SERVER' || $key == 'CPU' || $key == 'OS' || $key == 'TOTAL_RAM' - || $key == 'FREE_RAM' || $key == 'AIRTIME_VERSION' || $key == 'KERNAL_VERSION' - || $key == 'MACHINE_ARCHITECTURE' || $key == 'TOTAL_MEMORY_MBYTES' || $key == 'TOTAL_SWAP_MBYTES' - || $key == 'PLAYOUT_ENGINE_CPU_PERC') { + if ( + $key == 'WEB_SERVER' || $key == 'CPU' || $key == 'OS' || $key == 'TOTAL_RAM' + || $key == 'FREE_RAM' || $key == 'AIRTIME_VERSION' || $key == 'KERNAL_VERSION' + || $key == 'MACHINE_ARCHITECTURE' || $key == 'TOTAL_MEMORY_MBYTES' || $key == 'TOTAL_SWAP_MBYTES' + || $key == 'PLAYOUT_ENGINE_CPU_PERC' + ) { if ($key == 'AIRTIME_VERSION') { // remove hash tag on the version string $version = explode('+', $info[1]); @@ -1206,7 +1208,9 @@ class Application_Model_Preference { $v = self::getValue($pref_param, true); - $id = function ($x) { return $x; }; + $id = function ($x) { + return $x; + }; if ($v === '') { return $id; diff --git a/legacy/application/models/Scheduler.php b/legacy/application/models/Scheduler.php index 8f628e8eb..1d44c3b37 100644 --- a/legacy/application/models/Scheduler.php +++ b/legacy/application/models/Scheduler.php @@ -180,8 +180,10 @@ final class Application_Model_Scheduler $ccShowInstances = $ccShow->getCcShowInstancess(); $timeNowUTC = gmdate(DEFAULT_TIMESTAMP_FORMAT); foreach ($ccShowInstances as $ccShowInstance) { - if ($ccShowInstance->getDbStarts() <= $timeNowUTC - && $ccShowInstance->getDbEnds() > $timeNowUTC) { + if ( + $ccShowInstance->getDbStarts() <= $timeNowUTC + && $ccShowInstance->getDbEnds() > $timeNowUTC + ) { throw new Exception(_('Content in linked shows cannot be changed while on air!')); } } @@ -745,7 +747,7 @@ final class Application_Model_Scheduler // each show. In case the position does not exist we need to select // the end time of the last position $maxPos_sql = 'SELECT max(position) from cc_schedule ' . - "WHERE instance_id = {$instanceId}"; + "WHERE instance_id = {$instanceId}"; $pos = Application_Common_Database::prepareAndExecute( $maxPos_sql, [], @@ -923,7 +925,8 @@ final class Application_Model_Scheduler break; - default: break; + default: + break; } if ($this->applyCrossfades) { @@ -975,7 +978,7 @@ final class Application_Model_Scheduler $nextStartDT = $this->findTimeDifference($endTimeDT, $this->crossfadeDuration); ++$pos; - }// all files have been inserted/moved + } // all files have been inserted/moved if ($doInsert) { $insert_sql = 'INSERT INTO cc_schedule ' . '(starts, ends, cue_in, cue_out, fade_in, fade_out, ' . @@ -1044,8 +1047,8 @@ final class Application_Model_Scheduler if ($moveAction) { $this->calculateCrossfades($instanceId); } - }// for each instance - }// for each schedule location + } // for each instance + } // for each schedule location $endProfile = microtime(true); Logging::debug('finished adding scheduled items.'); diff --git a/legacy/application/models/Show.php b/legacy/application/models/Show.php index 6d2de43fb..447856ca5 100644 --- a/legacy/application/models/Show.php +++ b/legacy/application/models/Show.php @@ -339,7 +339,7 @@ SQL; if ($overlapping) { return _("Cannot schedule overlapping shows.\nNote: Resizing a repeating show " . - 'affects all of its repeats.'); + 'affects all of its repeats.'); } } @@ -428,7 +428,8 @@ SQL; $rows = Application_Common_Database::prepareAndExecute($sql, [ ':dayTimestamp' => $day_timestamp, - ':showId' => $this->getId(), ], 'all'); + ':showId' => $this->getId(), + ], 'all'); foreach ($rows as $row) { try { @@ -591,8 +592,10 @@ WHERE starts > :timestamp::TIMESTAMP SQL; Application_Common_Database::prepareAndExecute( $sql, - [':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), - ':showId' => $this->getId(), ], + [ + ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), + ':showId' => $this->getId(), + ], 'execute' ); } @@ -612,8 +615,10 @@ WHERE starts > :timestamp::TIMESTAMP SQL; Application_Common_Database::prepareAndExecute( $sql, - [':showId' => $this->getId(), - ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ], + [ + ':showId' => $this->getId(), + ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), + ], 'execute' ); } @@ -632,9 +637,9 @@ SQL; $showId = $this->getId(); $stmt = $con->prepare( 'SELECT first_show, start_time, timezone FROM cc_show_days' - . ' WHERE show_id = :showId' - . ' ORDER BY first_show' - . ' LIMIT 1' + . ' WHERE show_id = :showId' + . ' ORDER BY first_show' + . ' LIMIT 1' ); $stmt->bindParam(':showId', $showId); @@ -750,8 +755,10 @@ WHERE show_id = :showId SQL; $rows = Application_Common_Database::prepareAndExecute( $sql, - [':showId' => $this->getId(), - ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ], + [ + ':showId' => $this->getId(), + ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), + ], 'all' ); @@ -777,8 +784,8 @@ SQL; $timestamp = gmdate(DEFAULT_TIMESTAMP_FORMAT); $stmt = $con->prepare('UPDATE cc_show_days ' - . 'SET duration = :add_show_duration ' - . 'WHERE show_id = :add_show_id'); + . 'SET duration = :add_show_duration ' + . 'WHERE show_id = :add_show_id'); $stmt->execute([ ':add_show_duration' => $p_data['add_show_duration'], ':add_show_id' => $p_data['add_show_id'], @@ -794,7 +801,8 @@ SQL; Application_Common_Database::prepareAndExecute($sql, [ ':add_show_duration' => $p_data['add_show_duration'], ':show_id' => $p_data['add_show_id'], - ':timestamp' => $timestamp, ], 'execute'); + ':timestamp' => $timestamp, + ], 'execute'); } public function getDuration($format = false) @@ -896,8 +904,10 @@ SQL; try { $row = Application_Common_Database::prepareAndExecute( $sql, - [':showId' => $this->getId(), - ':timestamp' => $timestamp, ], + [ + ':showId' => $this->getId(), + ':timestamp' => $timestamp, + ], 'column' ); @@ -1092,8 +1102,10 @@ SQL; if ($p_editable) { if ($show['record'] && $now > $startsDT) { $options['editable'] = false; - } elseif ($show['rebroadcast'] - && $now > $parentStartsDT) { + } elseif ( + $show['rebroadcast'] + && $now > $parentStartsDT + ) { $options['editable'] = false; } elseif ($now < $endsDT) { $options['editable'] = true; @@ -1460,7 +1472,8 @@ SQL; 'ends' => $rows[$i - 1]['ends'], 'record' => $rows[$i - 1]['record'], 'image_path' => $rows[$i - 1]['image_path'], - 'type' => 'show', ]; + 'type' => 'show', + ]; } $results['currentShow'][0] = $rows[$i]; @@ -1478,7 +1491,8 @@ SQL; 'ends' => $rows[$i + 1]['ends'], 'record' => $rows[$i + 1]['record'], 'image_path' => $rows[$i + 1]['image_path'], - 'type' => 'show', ]; + 'type' => 'show', + ]; } break; @@ -1501,7 +1515,8 @@ SQL; 'ends' => $rows[$i]['ends'], 'record' => $rows[$i]['record'], 'image_path' => $rows[$i]['image_path'], - 'type' => 'show', ]; + 'type' => 'show', + ]; break; } @@ -1519,7 +1534,8 @@ SQL; 'starts' => $rows[$previousShowIndex]['starts'], 'ends' => $rows[$previousShowIndex]['ends'], 'record' => $rows[$previousShowIndex]['record'], - 'type' => 'show', ]; + 'type' => 'show', + ]; } return $results; @@ -1578,11 +1594,13 @@ SQL; $params = [ ':timeStart' => $timeStart, ':timeEnd' => $timeEnd, - ':lim' => $limit, ]; + ':lim' => $limit, + ]; } else { $params = [ ':timeStart' => $timeStart, - ':timeEnd' => $timeEnd, ]; + ':timeEnd' => $timeEnd, + ]; } return Application_Common_Database::prepareAndExecute($sql, $params, 'all'); diff --git a/legacy/application/models/ShowBuilder.php b/legacy/application/models/ShowBuilder.php index f37ded651..3567bd136 100644 --- a/legacy/application/models/ShowBuilder.php +++ b/legacy/application/models/ShowBuilder.php @@ -145,8 +145,10 @@ class Application_Model_ShowBuilder */ private function getScheduledStatus($p_epochItemStart, $p_epochItemEnd, &$row) { - if ($row['footer'] === true && $this->epoch_now > $p_epochItemStart - && $this->epoch_now > $p_epochItemEnd) { + if ( + $row['footer'] === true && $this->epoch_now > $p_epochItemStart + && $this->epoch_now > $p_epochItemEnd + ) { $row['scheduled'] = 0; } elseif ($row['footer'] === true && $this->epoch_now < $p_epochItemEnd) { $row['scheduled'] = 2; @@ -177,7 +179,8 @@ class Application_Model_ShowBuilder $d = [ '$p_epochItemStart' => $p_epochItemStart, '$p_epochItemEnd' => $p_epochItemEnd, - '$row' => $row, ]; + '$row' => $row, + ]; Logging::warn($d); } } @@ -415,8 +418,10 @@ class Application_Model_ShowBuilder // see if the displayed show instances have changed. (deleted, // empty schedule etc) - if ($outdated === false && count($instances) - !== count($currentInstances)) { + if ( + $outdated === false && count($instances) + !== count($currentInstances) + ) { Logging::debug('show instances have changed.'); $outdated = true; } @@ -450,8 +455,10 @@ class Application_Model_ShowBuilder $item = $scheduled_items[$i]; // don't send back data for filler rows. - if (isset($item['playout_status']) - && $item['playout_status'] < 0) { + if ( + isset($item['playout_status']) + && $item['playout_status'] < 0 + ) { continue; } @@ -480,20 +487,22 @@ class Application_Model_ShowBuilder $display_items[] = $row; } - if ($current_id !== -1 - && !in_array($current_id, $this->showInstances)) { + if ( + $current_id !== -1 + && !in_array($current_id, $this->showInstances) + ) { $this->showInstances[] = $current_id; } } // make the last footer if there were any scheduled items. if (count($scheduled_items) > 0) { - $display_items[] = $this->makeFooterRow($scheduled_items[ - count($scheduled_items) - 1]); + $display_items[] = $this->makeFooterRow($scheduled_items[count($scheduled_items) - 1]); } return [ 'schedule' => $display_items, - 'showInstances' => $this->showInstances, ]; + 'showInstances' => $this->showInstances, + ]; } } diff --git a/legacy/application/models/ShowInstance.php b/legacy/application/models/ShowInstance.php index 3862fb223..feacc7537 100644 --- a/legacy/application/models/ShowInstance.php +++ b/legacy/application/models/ShowInstance.php @@ -44,7 +44,8 @@ AND rebroadcast = 1; SQL; Application_Common_Database::prepareAndExecute($sql, [ ':instanceId' => $instance_id, - ':timestamp' => $timestamp, ], 'execute'); + ':timestamp' => $timestamp, + ], 'execute'); } /* This function is weird. It should return a boolean, but instead returns @@ -553,7 +554,8 @@ SQL; $counts = Application_Common_Database::prepareAndExecute($sql, [ ':p_start' => $p_start->format('Y-m-d G:i:s'), - ':p_end' => $p_end->format('Y-m-d G:i:s'), ], 'all'); + ':p_end' => $p_end->format('Y-m-d G:i:s'), + ], 'all'); $real_counts = []; foreach ($counts as $c) { @@ -574,7 +576,8 @@ SQL; $res = Application_Common_Database::prepareAndExecute($sql, [ ':p_start' => $p_start->format('Y-m-d G:i:s'), - ':p_end' => $p_end->format('Y-m-d G:i:s'), ], 'all'); + ':p_end' => $p_end->format('Y-m-d G:i:s'), + ], 'all'); $isFilled = []; foreach ($res as $r) { @@ -755,7 +758,8 @@ WHERE si.ends < :timeNow::TIMESTAMP ORDER BY si.ends DESC LIMIT 1; SQL; $id = Application_Common_Database($sql, [ - ':timeNow' => $p_timeNow, ], 'column'); + ':timeNow' => $p_timeNow, + ], 'column'); return $id ? new Application_Model_ShowInstance($id) : null; } @@ -779,7 +783,8 @@ SQL; $id = Application_Common_Database($sql, [ ':timeNow1' => $p_timeNow, - ':timeNow2' => $p_timeNow, ], 'column'); + ':timeNow2' => $p_timeNow, + ], 'column'); return $id ? new Application_Model_ShowInstance($id) : null; } @@ -835,7 +840,8 @@ SQL; return Application_Common_Database::prepareAndExecute($sql, [ ':startTime' => $p_startTime, - ':endTime' => $p_endTime, ], 'all'); + ':endTime' => $p_endTime, + ], 'all'); } public function isRepeating() diff --git a/legacy/application/models/StreamSetting.php b/legacy/application/models/StreamSetting.php index f1392c671..43c789ec4 100644 --- a/legacy/application/models/StreamSetting.php +++ b/legacy/application/models/StreamSetting.php @@ -25,11 +25,11 @@ class Application_Model_StreamSetting if ($result == 1) { $sql = 'UPDATE cc_stream_setting' - . ' SET value = :value, type = :type' - . ' WHERE keyname = :key'; + . ' SET value = :value, type = :type' + . ' WHERE keyname = :key'; } else { $sql = 'INSERT INTO cc_stream_setting (keyname, value, type)' - . ' VALUES (:key, :value, :type)'; + . ' VALUES (:key, :value, :type)'; } $stmt = $con->prepare($sql); @@ -52,7 +52,7 @@ class Application_Model_StreamSetting // Check if key already exists $sql = 'SELECT value FROM cc_stream_setting' - . ' WHERE keyname = :key'; + . ' WHERE keyname = :key'; $stmt = $con->prepare($sql); $stmt->bindParam(':key', $key); @@ -100,9 +100,9 @@ class Application_Model_StreamSetting { $con = Propel::getConnection(); $sql = 'SELECT * ' - . 'FROM cc_stream_setting ' - . "WHERE keyname LIKE '%_enable' " - . "AND value='true'"; + . 'FROM cc_stream_setting ' + . "WHERE keyname LIKE '%_enable' " + . "AND value='true'"; $ids = []; @@ -392,7 +392,7 @@ class Application_Model_StreamSetting $keyname = 's' . $stream_id . '_enable'; $sql = 'SELECT value FROM cc_stream_setting' - . ' WHERE keyname = :keyname'; + . ' WHERE keyname = :keyname'; $stmt = $con->prepare($sql); $stmt->bindParam(':keyname', $keyname); diff --git a/legacy/application/models/Subjects.php b/legacy/application/models/Subjects.php index e6adc1859..94c559302 100644 --- a/legacy/application/models/Subjects.php +++ b/legacy/application/models/Subjects.php @@ -1,4 +1,5 @@ $id, ], 'single'); + ':id' => $id, + ], 'single'); } } diff --git a/legacy/application/models/User.php b/legacy/application/models/User.php index c17968497..c6216db71 100644 --- a/legacy/application/models/User.php +++ b/legacy/application/models/User.php @@ -61,10 +61,12 @@ class Application_Model_User $type = $this->getType(); $result = false; - if ($this->isAdmin() + if ( + $this->isAdmin() || $this->isSuperAdmin() || $this->isPM() - || self::isHostOfShow($p_showId)) { + || self::isHostOfShow($p_showId) + ) { $result = true; } @@ -387,7 +389,8 @@ WHERE id = :id SQL; return Application_Common_Database::prepareAndExecute($sql, [ - ':id' => $id, ], 'single'); + ':id' => $id, + ], 'single'); } public static function getCurrentUser() diff --git a/legacy/application/models/Webstream.php b/legacy/application/models/Webstream.php index 7336156f7..47c368dc3 100644 --- a/legacy/application/models/Webstream.php +++ b/legacy/application/models/Webstream.php @@ -121,9 +121,11 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable public static function analyzeFormData($parameters) { - $valid = ['length' => [true, ''], + $valid = [ + 'length' => [true, ''], 'url' => [true, ''], - 'name' => [true, ''], ]; + 'name' => [true, ''], + ]; $di = null; $length = $parameters['length']; diff --git a/legacy/application/models/tests/StoredFileTests.php b/legacy/application/models/tests/StoredFileTests.php index ed0b0e96e..ccf485b61 100644 --- a/legacy/application/models/tests/StoredFileTests.php +++ b/legacy/application/models/tests/StoredFileTests.php @@ -21,10 +21,11 @@ class StoredFileTest extends PHPUnit_TestCase $metadata = Metadata::LoadFromFile($filePath); if (($metadata['dc:description'] != 'Tmu sem tam videla ...') || ($metadata['audio']['dataformat'] != 'mp3') - || ($metadata['dc:type'] != 'Speech')) { + || ($metadata['dc:type'] != 'Speech') + ) { $str = ' [dc:description] = ' . $metadata['dc:description'] . "\n" - . ' [audio][dataformat] = ' . $metadata['audio']['dataformat'] . "\n" - . ' [dc:type] = ' . $metadata['dc:type'] . "\n"; + . ' [audio][dataformat] = ' . $metadata['audio']['dataformat'] . "\n" + . ' [dc:type] = ' . $metadata['dc:type'] . "\n"; $this->fail("Metadata has unexpected values:\n" . $str); } // var_dump($metadata); @@ -44,8 +45,10 @@ class StoredFileTest extends PHPUnit_TestCase } // Test inserting a file by linking - $values = ['filepath' => $filePath, - 'dc:description' => 'Unit test ' . time(), ]; + $values = [ + 'filepath' => $filePath, + 'dc:description' => 'Unit test ' . time(), + ]; $storedFile = Application_Model_StoredFile::Insert($values, false); // var_dump($storedFile); $id = $storedFile->getId(); diff --git a/legacy/application/models/tests/plistEmbedded.xml b/legacy/application/models/tests/plistEmbedded.xml index a1af05a3f..85c9384fe 100644 --- a/legacy/application/models/tests/plistEmbedded.xml +++ b/legacy/application/models/tests/plistEmbedded.xml @@ -1,24 +1,12 @@ - - + + - - + - + embedded playlist 01:30:11.500000 diff --git a/legacy/application/models/tests/wstream1.xml b/legacy/application/models/tests/wstream1.xml index 57e228d8a..31a62abaf 100644 --- a/legacy/application/models/tests/wstream1.xml +++ b/legacy/application/models/tests/wstream1.xml @@ -1,12 +1,6 @@ - + Webstream test 1 01:30:00.000000 http://localhost/y diff --git a/legacy/application/modules/rest/Bootstrap.php b/legacy/application/modules/rest/Bootstrap.php index 67a7dcc07..bc35aa0a8 100644 --- a/legacy/application/modules/rest/Bootstrap.php +++ b/legacy/application/modules/rest/Bootstrap.php @@ -8,7 +8,8 @@ class Rest_Bootstrap extends Zend_Application_Module_Bootstrap $router = $front->getRouter(); $restRoute = new Zend_Rest_Route($front, [], [ - 'rest' => ['media', 'show-image', 'podcast', 'podcast-episodes'], ]); + 'rest' => ['media', 'show-image', 'podcast', 'podcast-episodes'], + ]); $router->addRoute('rest', $restRoute); $podcastBulkRoute = new Zend_Controller_Router_Route( diff --git a/legacy/application/modules/rest/controllers/PodcastEpisodesController.php b/legacy/application/modules/rest/controllers/PodcastEpisodesController.php index 61f2051a7..2dfd33d7c 100644 --- a/legacy/application/modules/rest/controllers/PodcastEpisodesController.php +++ b/legacy/application/modules/rest/controllers/PodcastEpisodesController.php @@ -96,7 +96,7 @@ class Rest_PodcastEpisodesController extends Zend_Rest_Controller $resp = $this->getResponse(); $resp->setHttpResponseCode(400); $resp->appendBody('ERROR: Episode ID should not be specified when using POST. POST is only used for ' - . 'importing podcast episodes, and an episode ID will be chosen by Airtime'); + . 'importing podcast episodes, and an episode ID will be chosen by Airtime'); return; } diff --git a/legacy/application/modules/rest/controllers/ShowImageController.php b/legacy/application/modules/rest/controllers/ShowImageController.php index 30a046505..53ec2249b 100644 --- a/legacy/application/modules/rest/controllers/ShowImageController.php +++ b/legacy/application/modules/rest/controllers/ShowImageController.php @@ -256,8 +256,8 @@ class Rest_ShowImageController extends Zend_Rest_Controller unlink($image_file); // remove the file after failed rename throw new Exception('The file was not uploaded, this error can occur if the computer ' - . 'hard drive does not have enough disk space or the stor ' - . 'directory does not have correct write permissions.'); + . 'hard drive does not have enough disk space or the stor ' + . 'directory does not have correct write permissions.'); } return $image_stor; diff --git a/legacy/application/modules/rest/helpers/RestAuth.php b/legacy/application/modules/rest/helpers/RestAuth.php index 214d003ce..c27729819 100644 --- a/legacy/application/modules/rest/helpers/RestAuth.php +++ b/legacy/application/modules/rest/helpers/RestAuth.php @@ -5,7 +5,8 @@ class RestAuth public static function verifyAuth($checkApiKey, $checkSession, $action) { // Session takes precedence over API key for now: - if ($checkSession && self::verifySession() + if ( + $checkSession && self::verifySession() || $checkApiKey && self::verifyAPIKey($action) ) { return true; diff --git a/legacy/application/services/CalendarService.php b/legacy/application/services/CalendarService.php index 16824c333..0021dc3df 100644 --- a/legacy/application/services/CalendarService.php +++ b/legacy/application/services/CalendarService.php @@ -46,19 +46,22 @@ class Application_Service_CalendarService if (!isset($ccFile)) { $menu['error when recording'] = [ 'name' => _("Record file doesn't exist"), - 'icon' => 'error', ]; + 'icon' => 'error', + ]; } else { $menu['view_recorded'] = [ 'name' => _('View Recorded File Metadata'), 'icon' => 'overview', - 'url' => $baseUrl . 'library/edit-file-md/id/' . $ccFile->getDbId(), ]; + 'url' => $baseUrl . 'library/edit-file-md/id/' . $ccFile->getDbId(), + ]; } } else { $menu['content'] = [ // "name"=> _("Show Content"), 'name' => _('View'), 'icon' => 'overview', - 'url' => $baseUrl . 'schedule/show-content-dialog', ]; + 'url' => $baseUrl . 'schedule/show-content-dialog', + ]; } } else { // Show content can be modified from the calendar if: @@ -77,7 +80,8 @@ class Application_Service_CalendarService // "name"=> _("Add / Remove Content"), 'name' => _('Schedule Tracks'), 'icon' => 'add-remove-content', - 'url' => $baseUrl . 'showbuilder/builder-dialog/', ]; + 'url' => $baseUrl . 'showbuilder/builder-dialog/', + ]; } } @@ -88,7 +92,8 @@ class Application_Service_CalendarService // "name"=> _("Show Content"), 'name' => _('View'), 'icon' => 'overview', - 'url' => $baseUrl . 'schedule/show-content-dialog', ]; + 'url' => $baseUrl . 'schedule/show-content-dialog', + ]; } // user can remove all content if the show has not started @@ -100,7 +105,8 @@ class Application_Service_CalendarService // "name"=> _("Remove All Content"), 'name' => _('Clear Show'), 'icon' => 'remove-all-content', - 'url' => $baseUrl . 'schedule/clear-show', ]; + 'url' => $baseUrl . 'schedule/clear-show', + ]; } } @@ -113,12 +119,14 @@ class Application_Service_CalendarService $menu['cancel_recorded'] = [ // "name"=> _("Cancel Current Show"), 'name' => _('Cancel Show'), - 'icon' => 'delete', ]; + 'icon' => 'delete', + ]; } else { $menu['cancel'] = [ // "name"=> _("Cancel Current Show"), 'name' => _('Cancel Show'), - 'icon' => 'delete', ]; + 'icon' => 'delete', + ]; } } @@ -167,7 +175,8 @@ class Application_Service_CalendarService 'name' => _('Edit Show'), 'icon' => 'edit', '_type' => 'all', - 'url' => $baseUrl . 'Schedule/populate-show-form', ]; + 'url' => $baseUrl . 'Schedule/populate-show-form', + ]; } } @@ -182,29 +191,34 @@ class Application_Service_CalendarService $menu['del'] = [ 'name' => _('Delete'), 'icon' => 'delete', - 'items' => [], ]; + 'items' => [], + ]; $menu['del']['items']['single'] = [ // "name"=> _("Delete This Instance"), 'name' => _('Delete Instance'), 'icon' => 'delete', - 'url' => $baseUrl . 'schedule/delete-show-instance', ]; + 'url' => $baseUrl . 'schedule/delete-show-instance', + ]; $menu['del']['items']['following'] = [ // "name"=> _("Delete This Instance and All Following"), 'name' => _('Delete Instance and All Following'), 'icon' => 'delete', - 'url' => $baseUrl . 'schedule/delete-show', ]; + 'url' => $baseUrl . 'schedule/delete-show', + ]; } elseif ($populateInstance) { $menu['del'] = [ 'name' => _('Delete'), 'icon' => 'delete', - 'url' => $baseUrl . 'schedule/delete-show-instance', ]; + 'url' => $baseUrl . 'schedule/delete-show-instance', + ]; } else { $menu['del'] = [ 'name' => _('Delete'), 'icon' => 'delete', - 'url' => $baseUrl . 'schedule/delete-show', ]; + 'url' => $baseUrl . 'schedule/delete-show', + ]; } } } diff --git a/legacy/application/services/HistoryService.php b/legacy/application/services/HistoryService.php index 5c2353ff9..5cf55bd74 100644 --- a/legacy/application/services/HistoryService.php +++ b/legacy/application/services/HistoryService.php @@ -56,8 +56,8 @@ class Application_Service_HistoryService // Using the instance_id to filter the data. $historyRange = '(' . - 'SELECT history.starts, history.ends, history.id AS history_id, history.instance_id' . - ' FROM cc_playout_history as history'; + 'SELECT history.starts, history.ends, history.id AS history_id, history.instance_id' . + ' FROM cc_playout_history as history'; if (isset($instanceId)) { $historyRange .= ' WHERE history.instance_id = :instance'; @@ -71,11 +71,11 @@ class Application_Service_HistoryService $historyRange .= ') AS history_range'; $manualMeta = '(' . - 'SELECT %KEY%.value AS %KEY%, %KEY%.history_id' . - ' FROM (' . - ' SELECT * from cc_playout_history_metadata AS phm WHERE phm.key = :meta_%KEY%' . - ' ) AS %KEY%' . - ' ) AS %KEY%_filter'; + 'SELECT %KEY%.value AS %KEY%, %KEY%.history_id' . + ' FROM (' . + ' SELECT * from cc_playout_history_metadata AS phm WHERE phm.key = :meta_%KEY%' . + ' ) AS %KEY%' . + ' ) AS %KEY%_filter'; $mainSelect = [ 'history_range.starts', @@ -112,39 +112,39 @@ class Application_Service_HistoryService // the files associated with scheduled playback in Airtime. $historyFile = '(' . - 'SELECT history.id AS history_id, history.file_id' . - ' FROM cc_playout_history AS history' . - ' WHERE history.file_id IS NOT NULL' . - ') AS history_file'; + 'SELECT history.id AS history_id, history.file_id' . + ' FROM cc_playout_history AS history' . + ' WHERE history.file_id IS NOT NULL' . + ') AS history_file'; $fileMd = '(' . - 'SELECT %NON_NULL_FILE_SELECT%' . - ' FROM cc_files AS file' . - ') AS file_md'; + 'SELECT %NON_NULL_FILE_SELECT%' . + ' FROM cc_files AS file' . + ') AS file_md'; $fileMd = str_replace('%NON_NULL_FILE_SELECT%', implode(', ', $nonNullFileSelect), $fileMd); // null files are from manually added data (filling in webstream info etc) $nullFile = '(' . - 'SELECT history.id AS history_id' . - ' FROM cc_playout_history AS history' . - ' WHERE history.file_id IS NULL' . - ') AS null_file'; + 'SELECT history.id AS history_id' . + ' FROM cc_playout_history AS history' . + ' WHERE history.file_id IS NULL' . + ') AS null_file'; // ---------------------------------- // building the file inner query $fileSqlQuery = - 'SELECT ' . implode(', ', $fileSelect) . - " FROM {$historyFile}" . - " LEFT JOIN {$fileMd} USING (file_id)" . - ' UNION' . - ' SELECT ' . implode(', ', $nullFileSelect) . - " FROM {$nullFile}"; + 'SELECT ' . implode(', ', $fileSelect) . + " FROM {$historyFile}" . + " LEFT JOIN {$fileMd} USING (file_id)" . + ' UNION' . + ' SELECT ' . implode(', ', $nullFileSelect) . + " FROM {$nullFile}"; foreach ($fileMdFilters as $filter) { $fileSqlQuery .= - " LEFT JOIN {$filter} USING(history_id)"; + " LEFT JOIN {$filter} USING(history_id)"; } } @@ -159,17 +159,17 @@ class Application_Service_HistoryService } $mainSqlQuery .= - 'SELECT ' . implode(', ', $mainSelect) . - " FROM {$historyRange}"; + 'SELECT ' . implode(', ', $mainSelect) . + " FROM {$historyRange}"; if (isset($fileSqlQuery)) { $mainSqlQuery .= - " LEFT JOIN ( {$fileSqlQuery} ) as file_info USING(history_id)"; + " LEFT JOIN ( {$fileSqlQuery} ) as file_info USING(history_id)"; } foreach ($mdFilters as $filter) { $mainSqlQuery .= - " LEFT JOIN {$filter} USING(history_id)"; + " LEFT JOIN {$filter} USING(history_id)"; } // ---------------------------------------------------------------------- @@ -217,7 +217,7 @@ class Application_Service_HistoryService $orders = implode(', ', $orderBys); $mainSqlQuery .= - " ORDER BY {$orders}"; + " ORDER BY {$orders}"; } // --------------------------------------------------------------- @@ -227,7 +227,7 @@ class Application_Service_HistoryService // limit the results returned. if ($displayLength !== -1) { $mainSqlQuery .= - ' OFFSET :offset LIMIT :limit'; + ' OFFSET :offset LIMIT :limit'; $paramMap['offset'] = intval($opts['iDisplayStart']); $paramMap['limit'] = $displayLength; @@ -340,8 +340,8 @@ class Application_Service_HistoryService LEFT JOIN cc_files AS file ON (file.id = playout.file_id)) AS summary'; $mainSqlQuery .= - 'SELECT ' . implode(', ', $select) . - " FROM {$fileSummaryTable}"; + 'SELECT ' . implode(', ', $select) . + " FROM {$fileSummaryTable}"; // ------------------------------------------------------------------------- // need to count the total rows to tell Datatables. @@ -376,7 +376,7 @@ class Application_Service_HistoryService $orders = implode(', ', $orderBys); $mainSqlQuery .= - " ORDER BY {$orders}"; + " ORDER BY {$orders}"; } // ------------------------------------------------------------ @@ -384,7 +384,7 @@ class Application_Service_HistoryService $displayLength = intval($opts['iDisplayLength']); if ($displayLength !== -1) { $mainSqlQuery .= - ' OFFSET :offset LIMIT :limit'; + ' OFFSET :offset LIMIT :limit'; $paramMap['offset'] = $opts['iDisplayStart']; $paramMap['limit'] = $displayLength; diff --git a/legacy/application/services/PodcastEpisodeService.php b/legacy/application/services/PodcastEpisodeService.php index 110e1e9c1..60343497f 100644 --- a/legacy/application/services/PodcastEpisodeService.php +++ b/legacy/application/services/PodcastEpisodeService.php @@ -189,7 +189,8 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir 'api_key' => $CC_CONFIG['apiKey'][0], 'podcast_name' => $title, 'album_override' => $album_override, - 'track_title' => $track_title, ]; + 'track_title' => $track_title, + ]; $task = $this->_executeTask(static::$_CELERY_TASKS[self::DOWNLOAD], $data); // Get the created ThirdPartyTaskReference and set the episode ID so // we can remove the placeholder if the import ends up stuck in a pending state @@ -378,7 +379,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir ->find(); return $isStationPodcast ? $this->_getStationPodcastEpisodeArray($episodes) - : $this->_getImportedPodcastEpisodeArray($podcast, $episodes); + : $this->_getImportedPodcastEpisodeArray($podcast, $episodes); } /** diff --git a/legacy/application/services/SchedulerService.php b/legacy/application/services/SchedulerService.php index 12f9ecbd8..4b2413f29 100644 --- a/legacy/application/services/SchedulerService.php +++ b/legacy/application/services/SchedulerService.php @@ -190,7 +190,7 @@ class Application_Service_SchedulerService $linkedShowSchedule_sql = $con->prepare( 'select * from cc_schedule where instance_id = :instance_id ' . - 'order by starts' + 'order by starts' ); $linkedShowSchedule_sql->bindParam(':instance_id', $instanceId); $linkedShowSchedule_sql->execute(); @@ -217,7 +217,7 @@ class Application_Service_SchedulerService // get time_filled so we can update cc_show_instances if (!empty($linkedShowSchedule)) { $timeFilled_sql = 'SELECT time_filled FROM cc_show_instances ' . - "WHERE id = {$linkedShowSchedule[0]['instance_id']}"; + "WHERE id = {$linkedShowSchedule[0]['instance_id']}"; $timeFilled = Application_Common_Database::prepareAndExecute( $timeFilled_sql, [], diff --git a/legacy/application/services/ShowFormService.php b/legacy/application/services/ShowFormService.php index 2ed1656b2..280cddcc5 100644 --- a/legacy/application/services/ShowFormService.php +++ b/legacy/application/services/ShowFormService.php @@ -67,16 +67,20 @@ class Application_Service_ShowFormService public function populateNewShowForms($formWhat, $formWhen, $formRepeats) { $formWhat->populate( - ['add_show_id' => '-1', - 'add_show_instance_id' => '-1', ] + [ + 'add_show_id' => '-1', + 'add_show_instance_id' => '-1', + ] ); $formWhen->populate( - ['add_show_start_date' => date('Y-m-d'), + [ + 'add_show_start_date' => date('Y-m-d'), 'add_show_start_time' => '00:00', 'add_show_end_date_no_repeate' => date('Y-m-d'), 'add_show_end_time' => '01:00', - 'add_show_duration' => '01h 00m', ] + 'add_show_duration' => '01h 00m', + ] ); $formRepeats->populate(['add_show_end_date' => date('Y-m-d')]); @@ -204,7 +208,8 @@ class Application_Service_ShowFormService 'add_show_end_time' => $showEnd->format('H:i'), 'add_show_duration' => $ccShowDay->formatDuration(true), 'add_show_timezone' => $ccShowDay->getDbTimezone(), - 'add_show_repeats' => $ccShowDay->isRepeating() ? 1 : 0, ] + 'add_show_repeats' => $ccShowDay->isRepeating() ? 1 : 0, + ] ); return $showStart; @@ -269,7 +274,8 @@ class Application_Service_ShowFormService $timezone ), 'add_show_timezone' => $timezone, - 'add_show_repeats' => 0, ] + 'add_show_repeats' => 0, + ] ); $form->getElement('add_show_repeats')->setOptions(['disabled' => true]); @@ -321,7 +327,8 @@ class Application_Service_ShowFormService 'add_show_day_check' => $days, 'add_show_end_date' => (!is_null($repeatEndDate)) ? $repeatEndDate->format('Y-m-d') : null, 'add_show_no_end' => (is_null($repeatEndDate)), - 'add_show_monthly_repeat_type' => $monthlyRepeatType, ] + 'add_show_monthly_repeat_type' => $monthlyRepeatType, + ] ); if (!$this->ccShow->isLinkable() || $this->ccShow->isRecorded()) { @@ -362,7 +369,8 @@ class Application_Service_ShowFormService [ 'add_show_background_color' => $this->ccShow->getDbBackgroundColor(), 'add_show_color' => $this->ccShow->getDbColor(), - 'add_show_logo_current' => $src, ] + 'add_show_logo_current' => $src, + ] ); } @@ -405,7 +413,8 @@ class Application_Service_ShowFormService 'cb_airtime_auth' => $this->ccShow->getDbLiveStreamUsingAirtimeAuth(), 'cb_custom_auth' => $this->ccShow->getDbLiveStreamUsingCustomAuth(), 'custom_username' => $this->ccShow->getDbLiveStreamUser(), - 'custom_password' => $this->ccShow->getDbLiveStreamPass(), ] + 'custom_password' => $this->ccShow->getDbLiveStreamPass(), + ] ); } @@ -414,7 +423,8 @@ class Application_Service_ShowFormService $form->populate( [ 'add_show_record' => $this->ccShow->isRecorded(), - 'add_show_rebroadcast' => $this->ccShow->isRebroadcast(), ] + 'add_show_rebroadcast' => $this->ccShow->isRebroadcast(), + ] ); $form->getElement('add_show_record')->setOptions(['disabled' => true]); diff --git a/legacy/application/services/ShowService.php b/legacy/application/services/ShowService.php index a4b680b1f..b1fc2e006 100644 --- a/legacy/application/services/ShowService.php +++ b/legacy/application/services/ShowService.php @@ -78,7 +78,7 @@ class Application_Service_ShowService // DateTime in shows's local time $newStartDateTime = new DateTime( $showData['add_show_start_date'] . ' ' . - $showData['add_show_start_time'], + $showData['add_show_start_time'], new DateTimeZone($showData['add_show_timezone']) ); @@ -261,8 +261,10 @@ class Application_Service_ShowService * to ignore that difference when re-calculating schedule start times. * Otherwise it might calculate a difference of a week, for example. */ - if ($this->ccShow->isRepeating() - && $this->origCcShowDay->getLocalStartDateAndTime()->format('Y-m-d') != $showData['add_show_start_date']) { + if ( + $this->ccShow->isRepeating() + && $this->origCcShowDay->getLocalStartDateAndTime()->format('Y-m-d') != $showData['add_show_start_date'] + ) { $showData['add_show_start_date'] = $this->origCcShowDay->getLocalStartDateAndTime()->format('Y-m-d'); } @@ -507,7 +509,8 @@ AND rebroadcast = 1; SQL; Application_Common_Database::prepareAndExecute($sql, [ ':showId' => $this->ccShow->getDbId(), - ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ], 'execute'); + ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), + ], 'execute'); } private function deleteAllShowDays($showId) @@ -572,11 +575,15 @@ SQL; // if the start date changes, these are the repeat types // that require show instance deletion - $deleteRepeatTypes = [REPEAT_BI_WEEKLY, REPEAT_TRI_WEEKLY, REPEAT_QUAD_WEEKLY, REPEAT_MONTHLY_MONTHLY, - REPEAT_MONTHLY_WEEKLY, ]; + $deleteRepeatTypes = [ + REPEAT_BI_WEEKLY, REPEAT_TRI_WEEKLY, REPEAT_QUAD_WEEKLY, REPEAT_MONTHLY_MONTHLY, + REPEAT_MONTHLY_WEEKLY, + ]; - if (in_array($this->repeatType, $deleteRepeatTypes) - && $showData['add_show_start_date'] != $localShowStart->format('Y-m-d')) { + if ( + in_array($this->repeatType, $deleteRepeatTypes) + && $showData['add_show_start_date'] != $localShowStart->format('Y-m-d') + ) { // Start date has changed when repeat type is bi-weekly or monthly. // This screws up the repeating positions of show instances, so // we need to delete them (CC-2351) @@ -631,8 +638,10 @@ SQL; } } - if ($showData['add_show_start_date'] != $localShowStart->format('Y-m-d') - || $showData['add_show_start_time'] != $localShowStart->format('H:i')) { + if ( + $showData['add_show_start_date'] != $localShowStart->format('Y-m-d') + || $showData['add_show_start_time'] != $localShowStart->format('H:i') + ) { // start date has been pushed forward so we need to delete // any instances of this show scheduled before the new start date if ($showData['add_show_start_date'] > $localShowStart->format('Y-m-d')) { @@ -723,7 +732,8 @@ WHERE date(starts) >= :endDate::DATE SQL; Application_Common_Database::prepareAndExecute($sql, [ ':endDate' => $endDate, ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), - ':showId' => $showId, ], 'execute'); + ':showId' => $showId, + ], 'execute'); } private function deleteInstancesBeforeDate($newStartDate, $showId) @@ -738,7 +748,8 @@ SQL; Application_Common_Database::prepareAndExecute($sql, [ ':newStartDate' => $newStartDate, ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), - ':showId' => $showId, ], 'execute'); + ':showId' => $showId, + ], 'execute'); } /** @@ -784,7 +795,8 @@ SQL; Application_Common_Database::prepareAndExecute( $sql, [ - ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ':showId' => $showId, ], + ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ':showId' => $showId, + ], 'execute' ); } @@ -977,8 +989,10 @@ WHERE starts > :timestamp::TIMESTAMP SQL; Application_Common_Database::prepareAndExecute( $sql, - [':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), - ':showId' => $showId, ], + [ + ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), + ':showId' => $showId, + ], 'execute' ); } @@ -996,9 +1010,11 @@ WHERE starts > :timestamp::TIMESTAMP SQL; Application_Common_Database::prepareAndExecute( $sql, - [':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), + [ + ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ':showId' => $showId, - ':firstShow' => $firstShow->format(DEFAULT_TIMESTAMP_FORMAT), ], + ':firstShow' => $firstShow->format(DEFAULT_TIMESTAMP_FORMAT), + ], 'execute' ); } @@ -1043,7 +1059,7 @@ SQL; // DateTime in show's local time $newStartDateTime = new DateTime( $showData['add_show_start_date'] . ' ' . - $showData['add_show_start_time'], + $showData['add_show_start_time'], new DateTimeZone($showData['add_show_timezone']) ); @@ -1088,8 +1104,10 @@ SQL; Application_Common_Database::prepareAndExecute( $sql, - [':diff1' => $diff, ':diff2' => $diff, - ':showId' => $this->ccShow->getDbId(), ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ], + [ + ':diff1' => $diff, ':diff2' => $diff, + ':showId' => $this->ccShow->getDbId(), ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), + ], 'execute' ); } @@ -1241,8 +1259,10 @@ SQL; * Make sure start date is less than populate until date AND * last show date is null OR start date is less than last show date */ - if ($utcStartDateTime <= $populateUntil - && (is_null($utcLastShowDateTime) || $utcStartDateTime < $utcLastShowDateTime)) { + if ( + $utcStartDateTime <= $populateUntil + && (is_null($utcLastShowDateTime) || $utcStartDateTime < $utcLastShowDateTime) + ) { $lastCreatedShow = clone $utcStartDateTime; /* There may not always be an instance when editing a show * This will be the case when we are adding a new show day to @@ -1341,9 +1361,11 @@ SQL; * Make sure start date is less than populate until date AND * last show date is null OR start date is less than last show date */ - if ($utcStartDateTime->getTimestamp() <= $populateUntil->getTimestamp() - && (is_null($utcLastShowDateTime) - || $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp())) { + if ( + $utcStartDateTime->getTimestamp() <= $populateUntil->getTimestamp() + && (is_null($utcLastShowDateTime) + || $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp()) + ) { $lastCreatedShow = clone $utcStartDateTime; /* There may not always be an instance when editing a show * This will be the case when we are adding a new show day to @@ -1742,8 +1764,10 @@ SQL; } if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) { if ($this->isUpdate) { - if ($this->origCcShowDay->getDbRepeatType() == 2 - || $this->origCcShowDay->getDbRepeatType() == 3) { + if ( + $this->origCcShowDay->getDbRepeatType() == 2 + || $this->origCcShowDay->getDbRepeatType() == 3 + ) { $day = null; } elseif (!$this->origShowRepeatStatus) { // keep current show day to use for updating cc_show_day rule diff --git a/legacy/application/services/ThirdPartyService.php b/legacy/application/services/ThirdPartyService.php index 9528466dc..2cb03ed0d 100644 --- a/legacy/application/services/ThirdPartyService.php +++ b/legacy/application/services/ThirdPartyService.php @@ -102,7 +102,7 @@ abstract class Application_Service_ThirdPartyService ->findOneByDbTrackReference($ref->getDbId()); return $task->getDbStatus() == CELERY_PENDING_STATUS ? -1 - : ($task->getDbStatus() == CELERY_FAILED_STATUS ? 0 : 1); + : ($task->getDbStatus() == CELERY_FAILED_STATUS ? 0 : 1); } return 0; diff --git a/legacy/application/views/helpers/SourceSwitchStatus.php b/legacy/application/views/helpers/SourceSwitchStatus.php index c801fbdcf..1797fd5c5 100644 --- a/legacy/application/views/helpers/SourceSwitchStatus.php +++ b/legacy/application/views/helpers/SourceSwitchStatus.php @@ -4,8 +4,10 @@ class Airtime_View_Helper_SourceSwitchStatus extends Zend_View_Helper_Abstract { public function SourceSwitchStatus() { - return ['live_dj' => Application_Model_Preference::GetSourceSwitchStatus('live_dj'), + return [ + 'live_dj' => Application_Model_Preference::GetSourceSwitchStatus('live_dj'), 'master_dj' => Application_Model_Preference::GetSourceSwitchStatus('master_dj'), - 'scheduled_play' => Application_Model_Preference::GetSourceSwitchStatus('scheduled_play'), ]; + 'scheduled_play' => Application_Model_Preference::GetSourceSwitchStatus('scheduled_play'), + ]; } } diff --git a/legacy/application/views/helpers/VersionNotify.php b/legacy/application/views/helpers/VersionNotify.php index 2968b45df..4b5ad579b 100644 --- a/legacy/application/views/helpers/VersionNotify.php +++ b/legacy/application/views/helpers/VersionNotify.php @@ -86,7 +86,7 @@ class Airtime_View_Helper_VersionNotify extends Zend_View_Helper_Abstract ]; return sprintf('', json_encode($data)) - . "
"; + . "
"; } private function normalizeVersion($version, $isGit) diff --git a/legacy/tests/application/models/unit/ScheduleUnitTest.php b/legacy/tests/application/models/unit/ScheduleUnitTest.php index d5e960e85..3bed88520 100644 --- a/legacy/tests/application/models/unit/ScheduleUnitTest.php +++ b/legacy/tests/application/models/unit/ScheduleUnitTest.php @@ -53,9 +53,11 @@ class ScheduleUnitTest extends Zend_Test_PHPUnit_ControllerTestCase // PHPUnit_F $params['api_key'] = $CC_CONFIG['apiKey'][0]; $request->setParams($params); - $metadata = ['MDATA_KEY_FILEPATH' => '/tmp/foobar.mp3', + $metadata = [ + 'MDATA_KEY_FILEPATH' => '/tmp/foobar.mp3', 'MDATA_KEY_DURATION' => '00:01:00', - 'is_record' => false, ]; + 'is_record' => false, + ]; // Create the file in the database via the HTTP API. $apiController = new ApiController($this->request, $this->getResponse()); diff --git a/legacy/tests/application/services/unit/ShowServiceUnitTest.php b/legacy/tests/application/services/unit/ShowServiceUnitTest.php index f8a6561a3..43a6ab358 100644 --- a/legacy/tests/application/services/unit/ShowServiceUnitTest.php +++ b/legacy/tests/application/services/unit/ShowServiceUnitTest.php @@ -86,15 +86,18 @@ class ShowServiceUnitTest extends PHPUnit_Framework_TestCase $method->setAccessible(true); $next = $method->invokeArgs($this->_showService, [ - new DateTime('2044-02-01'), 'UTC', '00:00', 'first', 'Friday', ]); + new DateTime('2044-02-01'), 'UTC', '00:00', 'first', 'Friday', + ]); $this->assertEquals(new DateTime('2044-02-05', new DateTimeZone('UTC')), $next); $next = $method->invokeArgs($this->_showService, [ - new DateTime('2044-02-01'), 'UTC', '00:00', 'fifth', 'Saturday', ]); + new DateTime('2044-02-01'), 'UTC', '00:00', 'fifth', 'Saturday', + ]); $this->assertEquals(new DateTime('2044-04-30', new DateTimeZone('UTC')), $next); $next = $method->invokeArgs($this->_showService, [ - new DateTime('2044-02-01'), 'UTC', '00:00', 'fourth', 'Monday', ]); + new DateTime('2044-02-01'), 'UTC', '00:00', 'fourth', 'Monday', + ]); $this->assertEquals(new DateTime('2044-02-22', new DateTimeZone('UTC')), $next); } @@ -111,7 +114,8 @@ class ShowServiceUnitTest extends PHPUnit_Framework_TestCase $dt = $method->invokeArgs($this->_showService, [$localStartDT, '01:00']); $this->assertEquals([ - $localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone), ], $dt); + $localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone), + ], $dt); // America/Toronto with offset for rebroadcast shows $localStartDT = new DateTime('2044-01-01 06:30', new DateTimeZone('America/Toronto')); @@ -120,10 +124,13 @@ class ShowServiceUnitTest extends PHPUnit_Framework_TestCase $localRebroadcastStartDT = new DateTime('2044-01-02 06:30', new DateTimeZone('America/Toronto')); $localRebroadcastEndDT = new DateTime('2044-01-02 07:30', new DateTimeZone('America/Toronto')); - $dt = $method->invokeArgs($this->_showService, [$localStartDT, '01:00', - ['days' => '1', 'hours' => '06', 'mins' => '30'], ]); + $dt = $method->invokeArgs($this->_showService, [ + $localStartDT, '01:00', + ['days' => '1', 'hours' => '06', 'mins' => '30'], + ]); $this->assertEquals([ - $localRebroadcastStartDT->setTimezone($utcTimezone), $localRebroadcastEndDT->setTimezone($utcTimezone), ], $dt); + $localRebroadcastStartDT->setTimezone($utcTimezone), $localRebroadcastEndDT->setTimezone($utcTimezone), + ], $dt); // Australia/Brisbane $localStartDT = new DateTime('2044-01-01 06:30', new DateTimeZone('Australia/Brisbane')); @@ -131,7 +138,8 @@ class ShowServiceUnitTest extends PHPUnit_Framework_TestCase $dt = $method->invokeArgs($this->_showService, [$localStartDT, '01:00']); $this->assertEquals([ - $localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone), ], $dt); + $localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone), + ], $dt); // America/Vancouver $localStartDT = new DateTime('2044-01-01 06:30', new DateTimeZone('America/Vancouver')); @@ -139,6 +147,7 @@ class ShowServiceUnitTest extends PHPUnit_Framework_TestCase $dt = $method->invokeArgs($this->_showService, [$localStartDT, '01:00']); $this->assertEquals([ - $localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone), ], $dt); + $localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone), + ], $dt); } }