style(legacy): php-cs-fixer upgrade

This commit is contained in:
jo 2022-07-11 17:07:30 +02:00 committed by Jonas L
parent 25fbf5cf32
commit c28fe32cdc
13 changed files with 22 additions and 23 deletions

View File

@ -15,7 +15,7 @@ class Application_Common_OsPath
$initial_slashes = false; $initial_slashes = false;
} }
if ( if (
($initial_slashes) $initial_slashes
&& (strpos($path, '//') === 0) && (strpos($path, '//') === 0)
&& (strpos($path, '///') === false) && (strpos($path, '///') === false)
) { ) {

View File

@ -105,14 +105,14 @@ class ApiController extends Zend_Controller_Action
$authAdapter = Zend_Auth::getInstance(); $authAdapter = Zend_Auth::getInstance();
Application_Model_Auth::pinSessionToClient($authAdapter); Application_Model_Auth::pinSessionToClient($authAdapter);
if ((Zend_Auth::getInstance()->hasIdentity())) { if (Zend_Auth::getInstance()->hasIdentity()) {
return true; return true;
} }
header('HTTP/1.0 401 Unauthorized'); header('HTTP/1.0 401 Unauthorized');
echo _('You are not allowed to access this resource.'); echo _('You are not allowed to access this resource.');
exit(); exit;
} }
public function versionAction() public function versionAction()

View File

@ -769,7 +769,7 @@ class ScheduleController extends Zend_Controller_Action
echo Zend_Json::encode($result); echo Zend_Json::encode($result);
exit(); exit;
} }
public function updateFutureIsScheduledAction() public function updateFutureIsScheduledAction()

View File

@ -183,7 +183,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
->appendBody('ERROR: CSRF token mismatch.') ->appendBody('ERROR: CSRF token mismatch.')
->sendResponse(); ->sendResponse();
exit(); exit;
} }
} }

View File

@ -1222,7 +1222,7 @@ SQL;
if ($field == 'utime' || $field == 'mtime' || $field == 'lptime') { if ($field == 'utime' || $field == 'mtime' || $field == 'lptime') {
// if the date isn't relative we want to convert the value to a specific UTC date // if the date isn't relative we want to convert the value to a specific UTC date
if (!(in_array($modifier, ['before', 'after', 'between']))) { if (!in_array($modifier, ['before', 'after', 'between'])) {
$value = Application_Common_DateHelper::UserTimezoneStringToUTCString($value); $value = Application_Common_DateHelper::UserTimezoneStringToUTCString($value);
} else { } else {
$value = $value . ' ' . $datetimeunit . ' ago'; $value = $value . ' ' . $datetimeunit . ' ago';
@ -1239,7 +1239,7 @@ SQL;
if (isset($d['sp_criteria_extra'])) { if (isset($d['sp_criteria_extra'])) {
if ($field == 'utime' || $field == 'mtime' || $field == 'lptime') { if ($field == 'utime' || $field == 'mtime' || $field == 'lptime') {
// if the date isn't relative we want to convert the value to a specific UTC date // if the date isn't relative we want to convert the value to a specific UTC date
if (!(in_array($modifier, ['before', 'after', 'between']))) { if (!in_array($modifier, ['before', 'after', 'between'])) {
$extra = Application_Common_DateHelper::UserTimezoneStringToUTCString($extra); $extra = Application_Common_DateHelper::UserTimezoneStringToUTCString($extra);
} else { } else {
$extra = $extra . ' ' . $extradatetimeunit . ' ago'; $extra = $extra . ' ' . $extradatetimeunit . ' ago';
@ -1676,7 +1676,7 @@ SQL;
// addslashes() does not esapce '%' so we have to do it manually // addslashes() does not esapce '%' so we have to do it manually
$spCriteriaValue = str_replace('%', '\%', $spCriteriaValue); $spCriteriaValue = str_replace('%', '\%', $spCriteriaValue);
} else { } else {
$spCriteriaValue = ($criteria['value']); $spCriteriaValue = $criteria['value'];
} }
$spCriteriaExtra = $criteria['extra']; $spCriteriaExtra = $criteria['extra'];
} }
@ -1772,9 +1772,9 @@ SQL;
if ($storedCrit['limit']['modifier'] == 'items') { if ($storedCrit['limit']['modifier'] == 'items') {
$limits['time'] = 1440 * 60; $limits['time'] = 1440 * 60;
$limits['items'] = $storedCrit['limit']['value']; $limits['items'] = $storedCrit['limit']['value'];
} elseif (($storedCrit['limit']['modifier'] == 'remaining')) { } elseif ($storedCrit['limit']['modifier'] == 'remaining') {
// show will be null unless being called inside a show instance // show will be null unless being called inside a show instance
if (!(is_null($showLimit))) { if (!is_null($showLimit)) {
$limits['time'] = $showLimit; $limits['time'] = $showLimit;
$limits['items'] = null; $limits['items'] = null;
} else { } else {

View File

@ -170,7 +170,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
Application_Service_PodcastService::deletePodcastById($id); Application_Service_PodcastService::deletePodcastById($id);
} }
break; break;
case HttpRequestType::GET: case HttpRequestType::GET:
$path = 'podcast/podcast.phtml'; $path = 'podcast/podcast.phtml';
@ -181,7 +181,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
]; ];
} }
break; break;
} }
$this->_helper->json->sendJson($responseBody); $this->_helper->json->sendJson($responseBody);

View File

@ -437,7 +437,7 @@ class Application_Service_HistoryService
Logging::info($shows); Logging::info($shows);
// need to filter the list to only their shows // need to filter the list to only their shows
if ((!empty($user)) && ($user->isHost())) { if ((!empty($user)) && $user->isHost()) {
$showIds = []; $showIds = [];
foreach ($shows as $show) { foreach ($shows as $show) {

View File

@ -128,7 +128,7 @@ class Application_Service_MediaService
*/ */
public static function areFilesStuckInPending() public static function areFilesStuckInPending()
{ {
$oneHourAgo = gmdate(DEFAULT_TIMESTAMP_FORMAT, (microtime(true) - self::PENDING_FILE_TIMEOUT_SECONDS)); $oneHourAgo = gmdate(DEFAULT_TIMESTAMP_FORMAT, microtime(true) - self::PENDING_FILE_TIMEOUT_SECONDS);
self::$_pendingFiles = CcFilesQuery::create() self::$_pendingFiles = CcFilesQuery::create()
->filterByDbImportStatus(CcFiles::IMPORT_STATUS_PENDING) ->filterByDbImportStatus(CcFiles::IMPORT_STATUS_PENDING)
->filterByDbUtime($oneHourAgo, Criteria::LESS_EQUAL) ->filterByDbUtime($oneHourAgo, Criteria::LESS_EQUAL)

View File

@ -300,7 +300,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
*/ */
public static function getStuckPendingImports() public static function getStuckPendingImports()
{ {
$timeout = gmdate(DEFAULT_TIMESTAMP_FORMAT, (microtime(true) - self::PENDING_EPISODE_TIMEOUT_SECONDS)); $timeout = gmdate(DEFAULT_TIMESTAMP_FORMAT, microtime(true) - self::PENDING_EPISODE_TIMEOUT_SECONDS);
$episodes = PodcastEpisodesQuery::create() $episodes = PodcastEpisodesQuery::create()
->filterByDbFileId() ->filterByDbFileId()
->find(); ->find();

View File

@ -324,7 +324,7 @@ class Application_Service_SchedulerService
$con->rollback(); $con->rollback();
Logging::info('Error filling linked shows: ' . $e->getMessage()); Logging::info('Error filling linked shows: ' . $e->getMessage());
exit(); exit;
} }
} }

View File

@ -326,7 +326,7 @@ class Application_Service_ShowFormService
'add_show_repeat_type' => $repeatType, 'add_show_repeat_type' => $repeatType,
'add_show_day_check' => $days, 'add_show_day_check' => $days,
'add_show_end_date' => (!is_null($repeatEndDate)) ? $repeatEndDate->format('Y-m-d') : null, 'add_show_end_date' => (!is_null($repeatEndDate)) ? $repeatEndDate->format('Y-m-d') : null,
'add_show_no_end' => (is_null($repeatEndDate)), 'add_show_no_end' => is_null($repeatEndDate),
'add_show_monthly_repeat_type' => $monthlyRepeatType, 'add_show_monthly_repeat_type' => $monthlyRepeatType,
] ]
); );

View File

@ -883,11 +883,10 @@ SQL;
CcShowQuery::create() CcShowQuery::create()
->filterByDbId($showId) ->filterByDbId($showId)
->delete(); ->delete();
/* There is only one cc_show_instance if the user selects 'Delete This Instance' // There is only one cc_show_instance if the user selects 'Delete This Instance'
* There is more than one cc_show_instance if the user selects 'Delete This // There is more than one cc_show_instance if the user selects 'Delete This
* Instance and All Following'. We only need to set the last_show value // Instance and All Following'. We only need to set the last_show value
* when 'Delete This Instance and All Following' has been selected // when 'Delete This Instance and All Following' has been selected
*/
} elseif (count($ccShowInstances) > 1) { } elseif (count($ccShowInstances) > 1) {
$this->setLastRepeatingShowDate($showId); $this->setLastRepeatingShowDate($showId);
} }

View File

@ -22,7 +22,7 @@ function showConfigCheckPage()
require_once CONFIG_PATH . '/config-check.php'; require_once CONFIG_PATH . '/config-check.php';
exit(); exit;
} }
function isApiCall() function isApiCall()