Skip to content

Commit

Permalink
Fixing codestyle for newer php-cs-fixer version
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar committed Jan 4, 2024
1 parent f093ff9 commit 0e082d5
Show file tree
Hide file tree
Showing 68 changed files with 175 additions and 175 deletions.
26 changes: 13 additions & 13 deletions administrator/components/com_admin/src/Model/SysinfoModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,17 @@ public function &getPhpSettings(): array
}

$this->php_settings = [
'memory_limit' => ini_get('memory_limit'),
'upload_max_filesize' => ini_get('upload_max_filesize'),
'post_max_size' => ini_get('post_max_size'),
'display_errors' => ini_get('display_errors') == '1',
'short_open_tag' => ini_get('short_open_tag') == '1',
'file_uploads' => ini_get('file_uploads') == '1',
'output_buffering' => (int) ini_get('output_buffering') !== 0,
'open_basedir' => ini_get('open_basedir'),
'session.save_path' => ini_get('session.save_path'),
'session.auto_start' => ini_get('session.auto_start'),
'disable_functions' => ini_get('disable_functions'),
'memory_limit' => \ini_get('memory_limit'),
'upload_max_filesize' => \ini_get('upload_max_filesize'),
'post_max_size' => \ini_get('post_max_size'),
'display_errors' => \ini_get('display_errors') == '1',
'short_open_tag' => \ini_get('short_open_tag') == '1',
'file_uploads' => \ini_get('file_uploads') == '1',
'output_buffering' => (int) \ini_get('output_buffering') !== 0,
'open_basedir' => \ini_get('open_basedir'),
'session.save_path' => \ini_get('session.save_path'),
'session.auto_start' => \ini_get('session.auto_start'),
'disable_functions' => \ini_get('disable_functions'),
'xml' => \extension_loaded('xml'),
'zlib' => \extension_loaded('zlib'),
'zip' => \function_exists('zip_open') && \function_exists('zip_read'),
Expand All @@ -263,7 +263,7 @@ public function &getPhpSettings(): array
'gd' => \extension_loaded('gd'),
'iconv' => \function_exists('iconv'),
'intl' => \function_exists('transliterator_transliterate'),
'max_input_vars' => ini_get('max_input_vars'),
'max_input_vars' => \ini_get('max_input_vars'),
];

return $this->php_settings;
Expand Down Expand Up @@ -355,7 +355,7 @@ private function getCompatPluginParameters()
public function phpinfoEnabled(): bool
{
// remove any spaces from the ini value before exploding it
$disabledFunctions = str_replace(' ', '', ini_get('disable_functions'));
$disabledFunctions = str_replace(' ', '', \ini_get('disable_functions'));
return !\in_array('phpinfo', explode(',', $disabledFunctions));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ protected function getListQuery()

$query->where('(' . implode(' OR ', $subCatItemsWhere) . ')');

// Case: Using only the by level filter
// Case: Using only the by level filter
} elseif ($level) {
$query->where($db->quoteName('a.level') . ' <= :level')
->bind(':level', $level, ParameterType::INTEGER);
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_finder/src/Indexer/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -926,15 +926,15 @@ protected function translateState($item, $category = null)
case 1:
return 1;

// Archived items should only show up when option is enabled
// Archived items should only show up when option is enabled
case 2:
if ($this->params->get('search_archived', 1) == 0) {
return 0;
}

return 1;

// All other states should return an unpublished state
// All other states should return an unpublished state
default:
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ protected function translateState($item, $category = null)
case 2:
return 1;

// All other states should return an unpublished state
// All other states should return an unpublished state
default:
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Html extends Parser
public function parse($input)
{
// Strip invalid UTF-8 characters.
$oldSetting = ini_get('mbstring.substitute_character');
$oldSetting = \ini_get('mbstring.substitute_character');
ini_set('mbstring.substitute_character', 'none');
$input = mb_convert_encoding($input, 'UTF-8', 'UTF-8');
ini_set('mbstring.substitute_character', $oldSetting);
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_finder/src/Indexer/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ protected function processString($input, $lang, $mode)

break;

// Handle a taxonomy branch filter.
// Handle a taxonomy branch filter.
default:
// Try to find the node id.
$return = Taxonomy::getNodeByTitle($modifier, $value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ protected function _getPackageFromUpload()
$userfile = $input->files->get('install_package', null, 'raw');

// Make sure that file uploads are enabled in php.
if (!(bool) ini_get('file_uploads')) {
if (!(bool) \ini_get('file_uploads')) {
Factory::getApplication()->enqueueMessage(Text::_('COM_INSTALLER_MSG_INSTALL_WARNINSTALLFILE'), 'error');

return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected function translate(&$items)
break;
case 'file':
$extension = 'files_' . $item->element;
$lang->load("$extension.sys", JPATH_SITE);
$lang->load("$extension.sys", JPATH_SITE);
break;
case 'library':
$parts = explode('/', $item->element);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ protected function preparePreUpdate($update, $table)

break;

// Modules could have a helper which adds additional data
// Modules could have a helper which adds additional data
case 'module':
$cname = str_replace('_', '', $table->element) . 'Helper';
$path = ($table->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/modules/' . $table->element . '/helper.php';
Expand All @@ -585,8 +585,8 @@ protected function preparePreUpdate($update, $table)

break;

// If we have a plugin, we can use the plugin trigger "onInstallerBeforePackageDownload"
// But we should make sure, that our plugin is loaded, so we don't need a second "installer" plugin
// If we have a plugin, we can use the plugin trigger "onInstallerBeforePackageDownload"
// But we should make sure, that our plugin is loaded, so we don't need a second "installer" plugin
case 'plugin':
$cname = str_replace('plg_', '', $table->element);
PluginHelper::importPlugin($table->folder, $cname);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,12 +631,12 @@ protected function getListQuery()
$supportedIDs = InstallerHelper::getDownloadKeySupportedSites($enabled);
break;

// Show Update Sites which are missing Download Keys
// Show Update Sites which are missing Download Keys
case -1:
$supportedIDs = InstallerHelper::getDownloadKeyExistsSites(false, $enabled);
break;

// Show Update Sites which have valid Download Keys
// Show Update Sites which have valid Download Keys
case 2:
$supportedIDs = InstallerHelper::getDownloadKeyExistsSites(true, $enabled);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function getItems()
// 16MB
$minLimit = 16 * 1024 * 1024;

$file_uploads = ini_get('file_uploads');
$file_uploads = \ini_get('file_uploads');

if (!$file_uploads) {
$messages[] = [
Expand All @@ -107,7 +107,7 @@ public function getItems()
];
}

$upload_dir = ini_get('upload_tmp_dir');
$upload_dir = \ini_get('upload_tmp_dir');

if (!$upload_dir) {
$messages[] = [
Expand Down Expand Up @@ -135,7 +135,7 @@ public function getItems()
];
}

$memory_limit = $this->return_bytes(ini_get('memory_limit'));
$memory_limit = $this->return_bytes(\ini_get('memory_limit'));

if ($memory_limit > -1) {
if ($memory_limit < $minLimit) {
Expand All @@ -153,8 +153,8 @@ public function getItems()
}
}

$post_max_size = $this->return_bytes(ini_get('post_max_size'));
$upload_max_filesize = $this->return_bytes(ini_get('upload_max_filesize'));
$post_max_size = $this->return_bytes(\ini_get('post_max_size'));
$upload_max_filesize = $this->return_bytes(\ini_get('upload_max_filesize'));

if ($post_max_size > 0 && $post_max_size < $upload_max_filesize) {
$messages[] = [
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_joomlaupdate/extract.php
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@ private function getPhpMaxExecTime(): int
return 10;
}

$phpMaxTime = @ini_get("maximum_execution_time");
$phpMaxTime = @\ini_get("maximum_execution_time");
$phpMaxTime = (!is_numeric($phpMaxTime) ? 10 : @\intval($phpMaxTime)) ?: 10;

return max(1, $phpMaxTime);
Expand Down Expand Up @@ -1694,9 +1694,9 @@ function clearFileInOPCache(string $file): bool
static $hasOpCache = null;

if (\is_null($hasOpCache)) {
$hasOpCache = ini_get('opcache.enable')
$hasOpCache = \ini_get('opcache.enable')
&& \function_exists('opcache_invalidate')
&& (!ini_get('opcache.restrict_api') || stripos(realpath($_SERVER['SCRIPT_FILENAME']), ini_get('opcache.restrict_api')) === 0);
&& (!\ini_get('opcache.restrict_api') || stripos(realpath($_SERVER['SCRIPT_FILENAME']), \ini_get('opcache.restrict_api')) === 0);
}

if ($hasOpCache && (strtolower(substr($file, -4)) === '.php')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function applyUpdateSite()
$params = ComponentHelper::getParams('com_joomlaupdate');

switch ($params->get('updatesource', 'nochange')) {
// "Minor & Patch Release for Current version AND Next Major Release".
// "Minor & Patch Release for Current version AND Next Major Release".
case 'next':
$updateURL = 'https://update.joomla.org/core/sts/list_sts.xml';
break;
Expand Down Expand Up @@ -930,7 +930,7 @@ public function upload()
$userfile = $input->files->get('install_package', null, 'raw');

// Make sure that file uploads are enabled in php.
if (!(bool) ini_get('file_uploads')) {
if (!(bool) \ini_get('file_uploads')) {
throw new \RuntimeException(Text::_('COM_INSTALLER_MSG_INSTALL_WARNINSTALLFILE'), 500);
}

Expand Down Expand Up @@ -1103,7 +1103,7 @@ public function getPhpOptions()
// Check for default MB language.
$option = new \stdClass();
$option->label = Text::_('INSTL_MB_LANGUAGE_IS_DEFAULT');
$option->state = strtolower(ini_get('mbstring.language')) === 'neutral';
$option->state = strtolower(\ini_get('mbstring.language')) === 'neutral';
$option->notice = $option->state ? null : Text::_('INSTL_NOTICEMBLANGNOTDEFAULT');
$options[] = $option;
}
Expand Down Expand Up @@ -1159,28 +1159,28 @@ public function getPhpSettings()
// Check for display errors.
$setting = new \stdClass();
$setting->label = Text::_('INSTL_DISPLAY_ERRORS');
$setting->state = (bool) ini_get('display_errors');
$setting->state = (bool) \ini_get('display_errors');
$setting->recommended = false;
$settings[] = $setting;

// Check for file uploads.
$setting = new \stdClass();
$setting->label = Text::_('INSTL_FILE_UPLOADS');
$setting->state = (bool) ini_get('file_uploads');
$setting->state = (bool) \ini_get('file_uploads');
$setting->recommended = true;
$settings[] = $setting;

// Check for output buffering.
$setting = new \stdClass();
$setting->label = Text::_('INSTL_OUTPUT_BUFFERING');
$setting->state = (int) ini_get('output_buffering') !== 0;
$setting->state = (int) \ini_get('output_buffering') !== 0;
$setting->recommended = false;
$settings[] = $setting;

// Check for session auto-start.
$setting = new \stdClass();
$setting->label = Text::_('INSTL_SESSION_AUTO_START');
$setting->state = (bool) ini_get('session.auto_start');
$setting->state = (bool) \ini_get('session.auto_start');
$setting->recommended = false;
$settings[] = $setting;

Expand Down Expand Up @@ -1291,7 +1291,7 @@ private function getTargetMinimumPHPVersion()
*/
public function getIniParserAvailability()
{
$disabledFunctions = ini_get('disable_functions');
$disabledFunctions = \ini_get('disable_functions');

if (!empty($disabledFunctions)) {
// Attempt to detect them in the PHP INI disable_functions variable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,26 +239,26 @@ public function display($tpl = null)
$this->updateSourceKey = Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_NEXT');
break;

// "Testing"
// "Testing"
case 'testing':
$this->langKey = 'COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_TESTING';
$this->updateSourceKey = Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_TESTING');
break;

// "Custom"
// "Custom"
case 'custom':
$this->langKey = 'COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_CUSTOM';
$this->updateSourceKey = Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_CUSTOM');
break;

/**
* "Minor & Patch Release for Current version (recommended and default)".
* The commented "case" below are for documenting where 'default' and legacy options falls
* case 'default':
* case 'sts':
* case 'lts':
* case 'nochange':
*/
/**
* "Minor & Patch Release for Current version (recommended and default)".
* The commented "case" below are for documenting where 'default' and legacy options falls
* case 'default':
* case 'sts':
* case 'lts':
* case 'nochange':
*/
default:
$this->langKey = 'COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_DEFAULT';
$this->updateSourceKey = Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_DEFAULT');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ private function checkContent()
$contentLength = $this->input->server->getInt('CONTENT_LENGTH');
$params = ComponentHelper::getParams('com_media');
$paramsUploadMaxsize = $params->get('upload_maxsize', 0) * 1024 * 1024;
$uploadMaxFilesize = $helper->toBytes(ini_get('upload_max_filesize'));
$postMaxSize = $helper->toBytes(ini_get('post_max_size'));
$memoryLimit = $helper->toBytes(ini_get('memory_limit'));
$uploadMaxFilesize = $helper->toBytes(\ini_get('upload_max_filesize'));
$postMaxSize = $helper->toBytes(\ini_get('post_max_size'));
$memoryLimit = $helper->toBytes(\ini_get('memory_limit'));

if (
($paramsUploadMaxsize > 0 && $contentLength > $paramsUploadMaxsize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function oauthcallback()
$this->setRedirect(Route::_('index.php?option=com_media&view=plugin&action=close', false));
break;

// Redirect browser to any page specified by the user
// Redirect browser to any page specified by the user
case 'redirect':
if (!isset($eventResults['redirect_uri'])) {
throw new \Exception("Redirect URI must be set in the plugin");
Expand All @@ -111,12 +111,12 @@ public function oauthcallback()
$this->setRedirect($eventResults['redirect_uri']);
break;

// Redirect browser to Control Panel
// Redirect browser to Control Panel
case 'control-panel':
$this->setRedirect(Route::_('index.php', false));
break;

// Redirect browser to Media Manager
// Redirect browser to Media Manager
case 'media-manager':
default:
$this->setRedirect(Route::_('index.php?option=com_media&view=media', false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function display($tpl = null)
case 'component':
default:
// Load language
$lang->load($item->componentname . '.sys', JPATH_ADMINISTRATOR)
$lang->load($item->componentname . '.sys', JPATH_ADMINISTRATOR)
|| $lang->load($item->componentname . '.sys', JPATH_ADMINISTRATOR . '/components/' . $item->componentname);

if (!empty($item->componentname)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ private function canTransition($item, $newStatus)
// A confirmed item can be marked completed or invalid
return \in_array($newStatus, ['-1', '2'], true);

// An item which is already in an invalid or complete state cannot transition, likewise if we don't know the state don't change anything
// An item which is already in an invalid or complete state cannot transition, likewise if we don't know the state don't change anything
case '-1':
case '2':
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ protected function addToolbar()

break;

// Item is in a "locked" state and cannot transition
// Item is in a "locked" state and cannot transition
default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function canView($view)
case 'level':
return $canDo->get('core.admin');

// Default permissions.
// Default permissions.
default:
return true;
}
Expand Down

0 comments on commit 0e082d5

Please sign in to comment.