diff --git a/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php b/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php index 80873249fb37a..1b6bc1abf7c45 100644 --- a/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php +++ b/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php @@ -87,7 +87,7 @@ public function exportLogs() if (\count($data)) { try { $rows = ActionlogsHelper::getCsvData($data); - } catch (\InvalidArgumentException $exception) { + } catch (\InvalidArgumentException) { $this->setMessage(Text::_('COM_ACTIONLOGS_ERROR_COULD_NOT_EXPORT_DATA'), 'error'); $this->setRedirect(Route::_('index.php?option=com_actionlogs&view=actionlogs', false)); diff --git a/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php b/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php index 68cab09bbc17a..98d884a22dc7a 100644 --- a/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php +++ b/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php @@ -310,7 +310,7 @@ public static function loadActionLogPluginsLanguage() try { $rows = $db->loadObjectList(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { $rows = []; } diff --git a/administrator/components/com_actionlogs/src/Model/ActionlogModel.php b/administrator/components/com_actionlogs/src/Model/ActionlogModel.php index 8cbbbe2729a40..e8add077e3fe6 100644 --- a/administrator/components/com_actionlogs/src/Model/ActionlogModel.php +++ b/administrator/components/com_actionlogs/src/Model/ActionlogModel.php @@ -91,7 +91,7 @@ public function addLog($messages, $messageLanguageKey, $context, $userId = 0) try { $db->insertObject('#__action_logs', $logMessage); $loggedMessages[] = $logMessage; - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { // Ignore it } } @@ -99,7 +99,7 @@ public function addLog($messages, $messageLanguageKey, $context, $userId = 0) try { // Send notification email to users who choose to be notified about the action logs $this->sendNotificationEmails($loggedMessages, $user->name, $context); - } catch (MailDisabledException | phpMailerException $e) { + } catch (MailDisabledException | phpMailerException) { // Ignore it } } diff --git a/administrator/components/com_actionlogs/src/Model/ActionlogsModel.php b/administrator/components/com_actionlogs/src/Model/ActionlogsModel.php index f3883d9e06245..ca6c2a8289912 100644 --- a/administrator/components/com_actionlogs/src/Model/ActionlogsModel.php +++ b/administrator/components/com_actionlogs/src/Model/ActionlogsModel.php @@ -363,7 +363,7 @@ public function purge() { try { $this->getDatabase()->truncateTable('#__action_logs'); - } catch (\Exception $e) { + } catch (\Exception) { return false; } diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 502b447811ffb..91d04581f6391 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -3306,7 +3306,7 @@ protected function fixFilesystemPermissions() try { // Using hard-coded string because a new language string would not be available in all cases Log::add('Fixing permissions for files and folders.', Log::INFO, 'Update'); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { // Informational log only } diff --git a/administrator/components/com_admin/src/Model/SysinfoModel.php b/administrator/components/com_admin/src/Model/SysinfoModel.php index 2bd59bc01ee70..4c50f19218c25 100644 --- a/administrator/components/com_admin/src/Model/SysinfoModel.php +++ b/administrator/components/com_admin/src/Model/SysinfoModel.php @@ -466,7 +466,7 @@ public function getExtensions(): array } catch (\Exception $e) { try { Log::add(Text::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()), Log::WARNING, 'jerror'); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { Factory::getApplication()->enqueueMessage( Text::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()), 'warning' diff --git a/administrator/components/com_associations/src/Model/AssociationsModel.php b/administrator/components/com_associations/src/Model/AssociationsModel.php index 8f16fc2ddafd9..aa4da259de777 100644 --- a/administrator/components/com_associations/src/Model/AssociationsModel.php +++ b/administrator/components/com_associations/src/Model/AssociationsModel.php @@ -480,7 +480,7 @@ public function purge($context = '', $key = '') try { $db->execute(); - } catch (ExecutionFailureException $e) { + } catch (ExecutionFailureException) { $app->enqueueMessage(Text::_('COM_ASSOCIATIONS_PURGE_FAILED'), 'error'); return false; @@ -543,7 +543,7 @@ public function clean($context = '', $key = '') try { $db->execute(); - } catch (ExecutionFailureException $e) { + } catch (ExecutionFailureException) { $app->enqueueMessage(Text::_('COM_ASSOCIATIONS_DELETE_ORPHANS_FAILED'), 'error'); return false; diff --git a/administrator/components/com_cache/src/Model/CacheModel.php b/administrator/components/com_cache/src/Model/CacheModel.php index cae0a8d60401c..2c270a5c9a369 100644 --- a/administrator/components/com_cache/src/Model/CacheModel.php +++ b/administrator/components/com_cache/src/Model/CacheModel.php @@ -153,10 +153,10 @@ public function getData() } else { $this->_data = []; } - } catch (CacheConnectingException $exception) { + } catch (CacheConnectingException) { $this->setError(Text::_('COM_CACHE_ERROR_CACHE_CONNECTION_FAILED')); $this->_data = []; - } catch (UnsupportedCacheException $exception) { + } catch (UnsupportedCacheException) { $this->setError(Text::_('COM_CACHE_ERROR_CACHE_DRIVER_UNSUPPORTED')); $this->_data = []; } @@ -224,9 +224,9 @@ public function clean($group = '') { try { $this->getCache()->clean($group); - } catch (CacheConnectingException $exception) { + } catch (CacheConnectingException) { return false; - } catch (UnsupportedCacheException $exception) { + } catch (UnsupportedCacheException) { return false; } @@ -264,9 +264,9 @@ public function purge() { try { Factory::getCache('')->gc(); - } catch (CacheConnectingException $exception) { + } catch (CacheConnectingException) { return false; - } catch (UnsupportedCacheException $exception) { + } catch (UnsupportedCacheException) { return false; } diff --git a/administrator/components/com_config/src/Model/ApplicationModel.php b/administrator/components/com_config/src/Model/ApplicationModel.php index 4fbe8c5651ae9..1a5847c24553e 100644 --- a/administrator/components/com_config/src/Model/ApplicationModel.php +++ b/administrator/components/com_config/src/Model/ApplicationModel.php @@ -488,7 +488,7 @@ public function save($data) } else { $revisedDbo->truncateTable('#__session'); } - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { /* * The database API logs errors on failures so we don't need to add any error handling mechanisms here. * Also, this data won't be added or checked anymore once the configuration is saved, so it'll purge itself @@ -519,7 +519,7 @@ public function save($data) Log::WARNING, 'jerror' ); - } catch (\RuntimeException $logException) { + } catch (\RuntimeException) { $app->enqueueMessage( Text::sprintf( 'COM_CONFIG_ERROR_CUSTOM_SESSION_FILESYSTEM_PATH_NOTWRITABLE_USING_DEFAULT', @@ -596,7 +596,7 @@ public function save($data) Log::WARNING, 'jerror' ); - } catch (\RuntimeException $logException) { + } catch (\RuntimeException) { $app->enqueueMessage( Text::sprintf('COM_CONFIG_ERROR_CUSTOM_CACHE_PATH_NOTWRITABLE_USING_DEFAULT', $path, JPATH_CACHE), 'warning' @@ -612,7 +612,7 @@ public function save($data) if ($error) { try { Log::add(Text::sprintf('COM_CONFIG_ERROR_CACHE_PATH_NOTWRITABLE', $path), Log::WARNING, 'jerror'); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { $app->enqueueMessage(Text::sprintf('COM_CONFIG_ERROR_CACHE_PATH_NOTWRITABLE', $path), 'warning'); } @@ -629,16 +629,16 @@ public function save($data) if ((!$data['caching'] && $prev['caching']) || $data['cache_handler'] !== $prev['cache_handler']) { try { Factory::getCache()->clean(); - } catch (CacheConnectingException $exception) { + } catch (CacheConnectingException) { try { Log::add(Text::_('COM_CONFIG_ERROR_CACHE_CONNECTION_FAILED'), Log::WARNING, 'jerror'); - } catch (\RuntimeException $logException) { + } catch (\RuntimeException) { $app->enqueueMessage(Text::_('COM_CONFIG_ERROR_CACHE_CONNECTION_FAILED'), 'warning'); } - } catch (UnsupportedCacheException $exception) { + } catch (UnsupportedCacheException) { try { Log::add(Text::_('COM_CONFIG_ERROR_CACHE_DRIVER_UNSUPPORTED'), Log::WARNING, 'jerror'); - } catch (\RuntimeException $logException) { + } catch (\RuntimeException) { $app->enqueueMessage(Text::_('COM_CONFIG_ERROR_CACHE_DRIVER_UNSUPPORTED'), 'warning'); } } @@ -672,7 +672,7 @@ public function save($data) Log::WARNING, 'jerror' ); - } catch (\RuntimeException $logException) { + } catch (\RuntimeException) { $app->enqueueMessage( Text::sprintf('COM_CONFIG_ERROR_CUSTOM_TEMP_PATH_NOTWRITABLE_USING_DEFAULT', $path, $defaultTmpPath), 'warning' @@ -687,7 +687,7 @@ public function save($data) if ($error) { try { Log::add(Text::sprintf('COM_CONFIG_ERROR_TMP_PATH_NOTWRITABLE', $path), Log::WARNING, 'jerror'); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { $app->enqueueMessage(Text::sprintf('COM_CONFIG_ERROR_TMP_PATH_NOTWRITABLE', $path), 'warning'); } } @@ -721,7 +721,7 @@ public function save($data) Log::WARNING, 'jerror' ); - } catch (\RuntimeException $logException) { + } catch (\RuntimeException) { $app->enqueueMessage( Text::sprintf('COM_CONFIG_ERROR_CUSTOM_LOG_PATH_NOTWRITABLE_USING_DEFAULT', $path, $defaultLogPath), 'warning' @@ -735,7 +735,7 @@ public function save($data) if ($error) { try { Log::add(Text::sprintf('COM_CONFIG_ERROR_LOG_PATH_NOTWRITABLE', $path), Log::WARNING, 'jerror'); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { $app->enqueueMessage(Text::sprintf('COM_CONFIG_ERROR_LOG_PATH_NOTWRITABLE', $path), 'warning'); } } diff --git a/administrator/components/com_contenthistory/src/Helper/ContenthistoryHelper.php b/administrator/components/com_contenthistory/src/Helper/ContenthistoryHelper.php index 6dcab10af041b..fa56bd3587465 100644 --- a/administrator/components/com_contenthistory/src/Helper/ContenthistoryHelper.php +++ b/administrator/components/com_contenthistory/src/Helper/ContenthistoryHelper.php @@ -201,7 +201,7 @@ public static function getLookupValue($lookup, $value) try { $result = $db->loadResult(); - } catch (\Exception $e) { + } catch (\Exception) { // Ignore any errors and just return false return false; } diff --git a/administrator/components/com_contenthistory/src/Model/HistoryModel.php b/administrator/components/com_contenthistory/src/Model/HistoryModel.php index 73470f5645422..fa06f07b33773 100644 --- a/administrator/components/com_contenthistory/src/Model/HistoryModel.php +++ b/administrator/components/com_contenthistory/src/Model/HistoryModel.php @@ -152,7 +152,7 @@ public function delete(&$pks) if ($error) { try { Log::add($error, Log::WARNING, 'jerror'); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { Factory::getApplication()->enqueueMessage($error, 'warning'); } @@ -161,7 +161,7 @@ public function delete(&$pks) try { Log::add(Text::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'), Log::WARNING, 'jerror'); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { Factory::getApplication()->enqueueMessage(Text::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'), 'warning'); } @@ -259,7 +259,7 @@ public function keep(&$pks) if ($error) { try { Log::add($error, Log::WARNING, 'jerror'); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { Factory::getApplication()->enqueueMessage($error, 'warning'); } @@ -268,7 +268,7 @@ public function keep(&$pks) try { Log::add(Text::_('COM_CONTENTHISTORY_ERROR_KEEP_NOT_PERMITTED'), Log::WARNING, 'jerror'); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { Factory::getApplication()->enqueueMessage(Text::_('COM_CONTENTHISTORY_ERROR_KEEP_NOT_PERMITTED'), 'warning'); } diff --git a/administrator/components/com_fields/src/Model/FieldModel.php b/administrator/components/com_fields/src/Model/FieldModel.php index e0381166ed96d..88a7d0a1fc6ca 100644 --- a/administrator/components/com_fields/src/Model/FieldModel.php +++ b/administrator/components/com_fields/src/Model/FieldModel.php @@ -329,7 +329,7 @@ private function checkDefaultValue($data) if ($rule instanceof DatabaseAwareInterface) { try { $rule->setDatabase($this->getDatabase()); - } catch (DatabaseNotFoundException $e) { + } catch (DatabaseNotFoundException) { @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); $rule->setDatabase(Factory::getContainer()->get(DatabaseInterface::class)); } @@ -1060,11 +1060,11 @@ function () use ($component, $section) { // Try to get the categories for this component and section try { $cat = $componentObject->getCategory([], $section ?: ''); - } catch (SectionNotFoundException $e) { + } catch (SectionNotFoundException) { // Not found for component and section -> Now try once more without the section, so only component try { $cat = $componentObject->getCategory(); - } catch (SectionNotFoundException $e) { + } catch (SectionNotFoundException) { // If we haven't found it now, return (no categories available for this component) return null; } diff --git a/administrator/components/com_fields/src/Model/FieldsModel.php b/administrator/components/com_fields/src/Model/FieldsModel.php index aa6b8c112edc3..4993a1cfd1ca0 100644 --- a/administrator/components/com_fields/src/Model/FieldsModel.php +++ b/administrator/components/com_fields/src/Model/FieldsModel.php @@ -213,11 +213,11 @@ function () use ($parts) { // Try to get the categories for this component and section try { $cat = $componentObject->getCategory([], $parts[1] ?: ''); - } catch (SectionNotFoundException $e) { + } catch (SectionNotFoundException) { // Not found for component and section -> Now try once more without the section, so only component try { $cat = $componentObject->getCategory(); - } catch (SectionNotFoundException $e) { + } catch (SectionNotFoundException) { // If we haven't found it now, return (no categories available for this component) return null; } diff --git a/administrator/components/com_finder/src/Controller/IndexerController.php b/administrator/components/com_finder/src/Controller/IndexerController.php index ce5696d82b2e5..3adbf1b9b832e 100644 --- a/administrator/components/com_finder/src/Controller/IndexerController.php +++ b/administrator/components/com_finder/src/Controller/IndexerController.php @@ -65,7 +65,7 @@ public function start() // Log the start try { Log::add('Starting the indexer', Log::INFO); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { // Informational log only } @@ -137,7 +137,7 @@ public function batch() // Log the start try { Log::add('Starting the indexer batch process', Log::INFO); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { // Informational log only } @@ -196,7 +196,7 @@ public function batch() // Log batch completion and memory high-water mark. try { Log::add('Batch completed, peak memory usage: ' . number_format(memory_get_peak_usage(true)) . ' bytes', Log::INFO); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { // Informational log only } @@ -293,7 +293,7 @@ public static function sendResponse($data = null) if ($data instanceof \Exception) { try { Log::add($data->getMessage(), Log::ERROR); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { // Informational log only } diff --git a/administrator/components/com_finder/src/Field/ContentmapField.php b/administrator/components/com_finder/src/Field/ContentmapField.php index e35a26205d31a..ea005dc8e581d 100644 --- a/administrator/components/com_finder/src/Field/ContentmapField.php +++ b/administrator/components/com_finder/src/Field/ContentmapField.php @@ -63,7 +63,7 @@ protected function getGroups() try { $contentMap = $db->loadObjectList(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return []; } diff --git a/administrator/components/com_finder/src/Indexer/Indexer.php b/administrator/components/com_finder/src/Indexer/Indexer.php index 13a9823d724f1..6aec4b6572342 100644 --- a/administrator/components/com_finder/src/Indexer/Indexer.php +++ b/administrator/components/com_finder/src/Indexer/Indexer.php @@ -186,7 +186,7 @@ public static function getState() */ $memory_table_limit = (int) ($heapsize->Value / 800); $data->options->set('memory_table_limit', $memory_table_limit); - } catch (\Exception $e) { + } catch (\Exception) { // Something failed. We fall back to a reasonable guess. $data->options->set('memory_table_limit', 7500); } @@ -1008,7 +1008,7 @@ protected function toggleTables($memory) // Set the tokens aggregate table to Memory. $db->setQuery('ALTER TABLE ' . $db->quoteName('#__finder_tokens_aggregate') . ' ENGINE = MEMORY'); $db->execute(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { $supported = false; return true; diff --git a/administrator/components/com_finder/src/Indexer/Language.php b/administrator/components/com_finder/src/Indexer/Language.php index 805ad349a2ece..5481c66e8d294 100644 --- a/administrator/components/com_finder/src/Indexer/Language.php +++ b/administrator/components/com_finder/src/Indexer/Language.php @@ -81,7 +81,7 @@ public function __construct($locale = null) break; } } - } catch (NotFoundException $e) { + } catch (NotFoundException) { // We don't have a stemmer for the language } } diff --git a/administrator/components/com_finder/src/Response/Response.php b/administrator/components/com_finder/src/Response/Response.php index 28dc80ffeb5e5..39691a8520f84 100644 --- a/administrator/components/com_finder/src/Response/Response.php +++ b/administrator/components/com_finder/src/Response/Response.php @@ -152,7 +152,7 @@ public function __construct($state) // Log the error try { Log::add($state->getMessage(), Log::ERROR); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { // Informational log only } diff --git a/administrator/components/com_finder/src/Service/HTML/Filter.php b/administrator/components/com_finder/src/Service/HTML/Filter.php index 7e511918dd9c1..0d238cca30ad3 100644 --- a/administrator/components/com_finder/src/Service/HTML/Filter.php +++ b/administrator/components/com_finder/src/Service/HTML/Filter.php @@ -69,7 +69,7 @@ public function slider($options = []) try { $filter = $db->loadObject(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return null; } @@ -100,7 +100,7 @@ public function slider($options = []) try { $branches = $db->loadObjectList('id'); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return null; } @@ -141,7 +141,7 @@ public function slider($options = []) try { $nodes = $db->loadObjectList('id'); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return null; } @@ -238,7 +238,7 @@ public function select($idxQuery, $options) try { $filter = $db->loadObject(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return null; } @@ -273,7 +273,7 @@ public function select($idxQuery, $options) try { $branches = $db->loadObjectList('id'); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return null; } @@ -321,7 +321,7 @@ public function select($idxQuery, $options) try { $bv->nodes = $db->loadObjectList('id'); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return null; } diff --git a/administrator/components/com_finder/src/Service/HTML/Finder.php b/administrator/components/com_finder/src/Service/HTML/Finder.php index 642fcf86f5846..fa62a601879e0 100644 --- a/administrator/components/com_finder/src/Service/HTML/Finder.php +++ b/administrator/components/com_finder/src/Service/HTML/Finder.php @@ -50,7 +50,7 @@ public function typeslist() try { $rows = $db->loadObjectList(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return []; } diff --git a/administrator/components/com_guidedtours/src/Model/TourModel.php b/administrator/components/com_guidedtours/src/Model/TourModel.php index 439f8c5e749bf..022dd042537b2 100644 --- a/administrator/components/com_guidedtours/src/Model/TourModel.php +++ b/administrator/components/com_guidedtours/src/Model/TourModel.php @@ -562,7 +562,7 @@ public function isAutostart($pk): bool if ($result === null) { return false; } - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return false; } @@ -597,7 +597,7 @@ public function saveTourUserState($id, $state = ''): bool try { $result = $db->setQuery($query)->loadResult(); - } catch (\Exception $e) { + } catch (\Exception) { return false; } diff --git a/administrator/components/com_installer/src/Helper/InstallerHelper.php b/administrator/components/com_installer/src/Helper/InstallerHelper.php index f0899df2e4045..5be9411ad6e22 100644 --- a/administrator/components/com_installer/src/Helper/InstallerHelper.php +++ b/administrator/components/com_installer/src/Helper/InstallerHelper.php @@ -324,7 +324,7 @@ public static function getExtensionDownloadKey( try { $extension = new CMSObject($db->setQuery($query)->loadAssoc()); - } catch (\Exception $e) { + } catch (\Exception) { return [ 'supported' => false, 'valid' => false, @@ -481,7 +481,7 @@ protected static function getUpdateSitesInformation(bool $onlyEnabled): array } return $items; - } catch (\Exception $e) { + } catch (\Exception) { return []; } } diff --git a/administrator/components/com_installer/src/Model/DatabaseModel.php b/administrator/components/com_installer/src/Model/DatabaseModel.php index 0c7f2caa199e5..03b8ad4487f8d 100644 --- a/administrator/components/com_installer/src/Model/DatabaseModel.php +++ b/administrator/components/com_installer/src/Model/DatabaseModel.php @@ -479,7 +479,7 @@ public function fixSchemaVersion($changeSet, $extensionId) try { $db->execute(); - } catch (ExecutionFailureException $e) { + } catch (ExecutionFailureException) { return false; } diff --git a/administrator/components/com_installer/src/Model/DiscoverModel.php b/administrator/components/com_installer/src/Model/DiscoverModel.php index eeb5fec3b761b..52e24afc3d801 100644 --- a/administrator/components/com_installer/src/Model/DiscoverModel.php +++ b/administrator/components/com_installer/src/Model/DiscoverModel.php @@ -260,7 +260,7 @@ public function purge() try { $db->execute(); - } catch (ExecutionFailureException $e) { + } catch (ExecutionFailureException) { $this->_message = Text::_('COM_INSTALLER_MSG_DISCOVER_FAILEDTOPURGEEXTENSIONS'); return false; diff --git a/administrator/components/com_installer/src/Model/InstallModel.php b/administrator/components/com_installer/src/Model/InstallModel.php index 953e90d38fbf5..94784353b08d6 100644 --- a/administrator/components/com_installer/src/Model/InstallModel.php +++ b/administrator/components/com_installer/src/Model/InstallModel.php @@ -330,7 +330,7 @@ protected function _getPackageFromUpload() // Move uploaded file. try { File::upload($tmp_src, $tmp_dest, false, true); - } catch (FilesystemException $exception) { + } catch (FilesystemException) { Factory::getApplication()->enqueueMessage(Text::_('COM_INSTALLER_MSG_INSTALL_WARNINSTALLUPLOADERROR'), 'error'); return false; diff --git a/administrator/components/com_installer/src/Model/LanguagesModel.php b/administrator/components/com_installer/src/Model/LanguagesModel.php index 3bf548db3dfb2..192d6502f2a2f 100644 --- a/administrator/components/com_installer/src/Model/LanguagesModel.php +++ b/administrator/components/com_installer/src/Model/LanguagesModel.php @@ -136,7 +136,7 @@ protected function getLanguages() try { $response = HttpFactory::getHttp()->get($updateSite); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { $response = null; } diff --git a/administrator/components/com_installer/src/Model/UpdateModel.php b/administrator/components/com_installer/src/Model/UpdateModel.php index 2cd000b8ca4a0..49c04a7c110f6 100644 --- a/administrator/components/com_installer/src/Model/UpdateModel.php +++ b/administrator/components/com_installer/src/Model/UpdateModel.php @@ -286,7 +286,7 @@ public function purge() try { $db->truncateTable('#__updates'); - } catch (ExecutionFailureException $e) { + } catch (ExecutionFailureException) { $this->_message = Text::_('JLIB_INSTALLER_FAILED_TO_PURGE_UPDATES'); return false; diff --git a/administrator/components/com_installer/src/Model/UpdatesiteModel.php b/administrator/components/com_installer/src/Model/UpdatesiteModel.php index cdb5f0528eaaa..5b2efd737254c 100644 --- a/administrator/components/com_installer/src/Model/UpdatesiteModel.php +++ b/administrator/components/com_installer/src/Model/UpdatesiteModel.php @@ -161,7 +161,7 @@ public function save($data): bool try { $db->setQuery($query)->execute(); - } catch (\Exception $e) { + } catch (\Exception) { // No problem if this fails for any reason. } diff --git a/administrator/components/com_joomlaupdate/src/Controller/UpdateController.php b/administrator/components/com_joomlaupdate/src/Controller/UpdateController.php index 53ea811db91fa..a53cf2e5f40f8 100644 --- a/administrator/components/com_joomlaupdate/src/Controller/UpdateController.php +++ b/administrator/components/com_joomlaupdate/src/Controller/UpdateController.php @@ -375,7 +375,7 @@ public function confirm() try { Log::add(Text::sprintf('COM_JOOMLAUPDATE_UPDATE_LOG_FILE', $tempFile), Log::INFO, 'Update'); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { // Informational log only } diff --git a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php index 5d75b416ba537..856d96602d07f 100644 --- a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php +++ b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php @@ -384,7 +384,7 @@ public function download() try { $head = HttpFactory::getHttp($httpOptions)->head($packageURL); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { // Passing false here -> download failed message return $response; } @@ -395,7 +395,7 @@ public function download() try { $head = HttpFactory::getHttp($httpOptions)->head($packageURL); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { // Passing false here -> download failed message return $response; } @@ -512,7 +512,7 @@ protected function downloadPackage($url, $target) if (is_file($target)) { try { File::delete($target); - } catch (FilesystemException $exception) { + } catch (FilesystemException) { return false; } } @@ -520,7 +520,7 @@ protected function downloadPackage($url, $target) // Download the package try { $result = HttpFactory::getHttp([], ['curl', 'stream'])->get($url); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return false; } @@ -534,7 +534,7 @@ protected function downloadPackage($url, $target) // Write the file to disk try { File::write($target, $body); - } catch (FilesystemException $exception) { + } catch (FilesystemException) { return false; } @@ -619,7 +619,7 @@ public function createUpdateFile($basename = null): bool if (is_file($configpath)) { try { File::delete($configpath); - } catch (FilesystemException $exception) { + } catch (FilesystemException) { return false; } } @@ -627,7 +627,7 @@ public function createUpdateFile($basename = null): bool // Write new file. First try with File. try { $result = File::write($configpath, $data); - } catch (FilesystemException $exception) { + } catch (FilesystemException) { // In case File failed but direct access could help. $fp = @fopen($configpath, 'wt'); @@ -926,7 +926,7 @@ public function cleanUp() try { Log::add(Text::sprintf('COM_JOOMLAUPDATE_UPDATE_LOG_COMPLETE', \JVERSION), Log::INFO, 'Update'); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { // Informational log only } } @@ -1075,7 +1075,7 @@ public function removePackageFiles() if ($file !== null && is_file($file)) { try { File::delete($file); - } catch (FilesystemException $exception) { + } catch (FilesystemException) { } } } @@ -1596,7 +1596,7 @@ private function getCollectionDetailsUrls($updateSiteInfo, $joomlaTargetVersion) try { $response = $http->get($updateSiteInfo['location']); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { $response = null; } diff --git a/administrator/components/com_login/src/Model/LoginModel.php b/administrator/components/com_login/src/Model/LoginModel.php index 5c664a1104cdb..e84bcd1a655f1 100644 --- a/administrator/components/com_login/src/Model/LoginModel.php +++ b/administrator/components/com_login/src/Model/LoginModel.php @@ -179,7 +179,7 @@ protected static function _load($module) try { return $clean = $cache->get($loader, [], md5(serialize([$clientId, $lang]))); - } catch (CacheExceptionInterface $cacheException) { + } catch (CacheExceptionInterface) { try { return $loader(); } catch (ExecutionFailureException $databaseException) { diff --git a/administrator/components/com_mails/src/Model/TemplateModel.php b/administrator/components/com_mails/src/Model/TemplateModel.php index c6849b31a4de3..10ef8e8b0d3f7 100644 --- a/administrator/components/com_mails/src/Model/TemplateModel.php +++ b/administrator/components/com_mails/src/Model/TemplateModel.php @@ -126,7 +126,7 @@ public function getForm($data = [], $loadData = true) try { $attachmentPath = rtrim(Path::check(JPATH_ROOT . '/' . $params->get('attachment_folder')), \DIRECTORY_SEPARATOR); - } catch (\Exception $e) { + } catch (\Exception) { $attachmentPath = ''; } diff --git a/administrator/components/com_media/src/Model/ApiModel.php b/administrator/components/com_media/src/Model/ApiModel.php index 8526569ee99cd..d98f24e0cf1fa 100644 --- a/administrator/components/com_media/src/Model/ApiModel.php +++ b/administrator/components/com_media/src/Model/ApiModel.php @@ -170,7 +170,7 @@ public function createFolder($adapter, $name, $path, $override) { try { $file = $this->getFile($adapter, $path . '/' . $name); - } catch (FileNotFoundException $e) { + } catch (FileNotFoundException) { // Do nothing } @@ -220,7 +220,7 @@ public function createFile($adapter, $name, $path, $data, $override) { try { $file = $this->getFile($adapter, $path . '/' . $name); - } catch (FileNotFoundException $e) { + } catch (FileNotFoundException) { // Do nothing } diff --git a/administrator/components/com_media/src/Provider/ProviderManagerHelperTrait.php b/administrator/components/com_media/src/Provider/ProviderManagerHelperTrait.php index 7e1c44145b43f..863aad4e01c09 100644 --- a/administrator/components/com_media/src/Provider/ProviderManagerHelperTrait.php +++ b/administrator/components/com_media/src/Provider/ProviderManagerHelperTrait.php @@ -154,7 +154,7 @@ protected function getDefaultAdapterName(): ?string $defaultFilePath = ComponentHelper::getParams('com_media')->get('file_path', 'files'); $defaultAdapter = $this->getAdapter('local-' . $defaultFilePath); // @TODO: Need a proper configuration for default adapter. - } catch (ProviderAccountNotFoundException $e) { + } catch (ProviderAccountNotFoundException) { $defaultAdapter = null; } diff --git a/administrator/components/com_menus/src/Controller/ItemsController.php b/administrator/components/com_menus/src/Controller/ItemsController.php index 41e8ccd57aba5..04ad79e895226 100644 --- a/administrator/components/com_menus/src/Controller/ItemsController.php +++ b/administrator/components/com_menus/src/Controller/ItemsController.php @@ -194,7 +194,7 @@ public function publish() if (empty($cid)) { try { Log::add(Text::_($this->text_prefix . '_NO_ITEM_SELECTED'), Log::WARNING, 'jerror'); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { $this->setMessage(Text::_($this->text_prefix . '_NO_ITEM_SELECTED'), 'warning'); } } else { diff --git a/administrator/components/com_menus/src/Field/MenuItemByTypeField.php b/administrator/components/com_menus/src/Field/MenuItemByTypeField.php index 573b2829e16a8..c15ee03133574 100644 --- a/administrator/components/com_menus/src/Field/MenuItemByTypeField.php +++ b/administrator/components/com_menus/src/Field/MenuItemByTypeField.php @@ -197,7 +197,7 @@ protected function getGroups() try { $menuTitle = $db->loadResult(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { $menuTitle = $menuType; } diff --git a/administrator/components/com_menus/src/Helper/MenusHelper.php b/administrator/components/com_menus/src/Helper/MenusHelper.php index 6bfb7339d2d38..e47432b9a47ba 100644 --- a/administrator/components/com_menus/src/Helper/MenusHelper.php +++ b/administrator/components/com_menus/src/Helper/MenusHelper.php @@ -383,7 +383,7 @@ public static function getMenuItems($menutype, $enabledOnly = false, $exclude = $root->addChild($menuitem); } } - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { Factory::getApplication()->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); } @@ -719,7 +719,7 @@ public static function resolveAlias(&$item) return; } - } catch (\Exception $e) { + } catch (\Exception) { $item->link = ''; return; diff --git a/administrator/components/com_menus/src/Service/HTML/Menus.php b/administrator/components/com_menus/src/Service/HTML/Menus.php index 1b3fb9771a99c..081f6bce55368 100644 --- a/administrator/components/com_menus/src/Service/HTML/Menus.php +++ b/administrator/components/com_menus/src/Service/HTML/Menus.php @@ -121,7 +121,7 @@ public function visibility($params) try { $registry->loadString($params); - } catch (\Exception $e) { + } catch (\Exception) { // Invalid JSON } diff --git a/administrator/components/com_messages/src/Model/MessageModel.php b/administrator/components/com_messages/src/Model/MessageModel.php index b4547ca06250e..dd32322376d2b 100644 --- a/administrator/components/com_messages/src/Model/MessageModel.php +++ b/administrator/components/com_messages/src/Model/MessageModel.php @@ -102,7 +102,7 @@ public function delete(&$pks) try { Log::add(Text::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'), Log::WARNING, 'jerror'); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { Factory::getApplication()->enqueueMessage(Text::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'), 'warning'); } @@ -266,7 +266,7 @@ public function publish(&$pks, $value = 1) try { Log::add(Text::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'), Log::WARNING, 'jerror'); - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { Factory::getApplication()->enqueueMessage(Text::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'), 'warning'); } diff --git a/administrator/components/com_redirect/src/Model/LinksModel.php b/administrator/components/com_redirect/src/Model/LinksModel.php index ee095228a3c46..8fde16f511534 100644 --- a/administrator/components/com_redirect/src/Model/LinksModel.php +++ b/administrator/components/com_redirect/src/Model/LinksModel.php @@ -73,7 +73,7 @@ public function purge() try { $db->execute(); - } catch (\Exception $e) { + } catch (\Exception) { return false; } diff --git a/administrator/components/com_scheduler/src/Field/CronField.php b/administrator/components/com_scheduler/src/Field/CronField.php index f185e757ecacb..ea3d86a4440a0 100644 --- a/administrator/components/com_scheduler/src/Field/CronField.php +++ b/administrator/components/com_scheduler/src/Field/CronField.php @@ -159,7 +159,7 @@ protected function getOptions(): array if ($this->wildcard) { try { $options[] = HTMLHelper::_('select.option', '*', '*'); - } catch (\InvalidArgumentException $e) { + } catch (\InvalidArgumentException) { } } @@ -180,7 +180,7 @@ static function (string $string): string { for ([$i, $l] = [$optionLower, 0]; $i <= $optionUpper; $i++, $l++) { try { $options[] = HTMLHelper::_('select.option', (string) ($i), $labels[$l]); - } catch (\InvalidArgumentException $e) { + } catch (\InvalidArgumentException) { } } diff --git a/administrator/components/com_scheduler/src/Field/TaskTypeField.php b/administrator/components/com_scheduler/src/Field/TaskTypeField.php index d83520fabaa37..01fee619e1a01 100644 --- a/administrator/components/com_scheduler/src/Field/TaskTypeField.php +++ b/administrator/components/com_scheduler/src/Field/TaskTypeField.php @@ -58,7 +58,7 @@ protected function getOptions(): array $addTypeAsOption = function (TaskOption $type) use (&$options) { try { $options[] = HTMLHelper::_('select.option', $type->id, $type->title); - } catch (\InvalidArgumentException $e) { + } catch (\InvalidArgumentException) { } }; diff --git a/administrator/components/com_scheduler/src/Model/LogsModel.php b/administrator/components/com_scheduler/src/Model/LogsModel.php index 85ae4ed39261b..3823e6da9a423 100644 --- a/administrator/components/com_scheduler/src/Model/LogsModel.php +++ b/administrator/components/com_scheduler/src/Model/LogsModel.php @@ -66,7 +66,7 @@ public function purge() { try { $this->getDatabase()->truncateTable('#__scheduler_logs'); - } catch (\Exception $e) { + } catch (\Exception) { return false; } diff --git a/administrator/components/com_scheduler/src/Model/TaskModel.php b/administrator/components/com_scheduler/src/Model/TaskModel.php index e2c63a1e90dc5..70a2f02208bed 100644 --- a/administrator/components/com_scheduler/src/Model/TaskModel.php +++ b/administrator/components/com_scheduler/src/Model/TaskModel.php @@ -398,7 +398,7 @@ public function getTask(array $options = []): ?\stdClass $db->setQuery($lockQuery)->execute(); $affectedRows = $db->getAffectedRows(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return null; } finally { $db->unlockTables(); @@ -428,7 +428,7 @@ private function hasRunningTasks($db): bool try { $runningCount = $db->setQuery($lockCountQuery)->loadResult(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return false; } @@ -527,7 +527,7 @@ static function (TaskOption $taskOption): string { try { return $db->setQuery($idQuery)->loadColumn(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return []; } } @@ -551,7 +551,7 @@ private function fetchTask($db, $now): ?\stdClass try { $task = $db->setQuery($getQuery)->loadObject(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return null; } diff --git a/administrator/components/com_scheduler/src/Scheduler/Scheduler.php b/administrator/components/com_scheduler/src/Scheduler/Scheduler.php index 9aa254ed5adec..e81170c293e87 100644 --- a/administrator/components/com_scheduler/src/Scheduler/Scheduler.php +++ b/administrator/components/com_scheduler/src/Scheduler/Scheduler.php @@ -139,7 +139,7 @@ public function runTask(array $options): ?Task try { $task->run(); - } catch (\Exception $e) { + } catch (\Exception) { // We suppress the exception here, it's still accessible with `$task->getContent()['exception']`. } @@ -221,7 +221,7 @@ public function getTask(array $options = []): ?Task /** @var TaskModel $model */ $model = $component->getMVCFactory()->createModel('Task', 'Administrator', ['ignore_request' => true]); - } catch (\Exception $e) { + } catch (\Exception) { } if (!isset($model)) { @@ -293,7 +293,7 @@ public function fetchTaskRecords(array $filters, array $listConfig): array /** @var TasksModel $model */ $model = $component->getMVCFactory() ->createModel('Tasks', 'Administrator', ['ignore_request' => true]); - } catch (\Exception $e) { + } catch (\Exception) { } if (!$model) { diff --git a/administrator/components/com_scheduler/src/Task/Task.php b/administrator/components/com_scheduler/src/Task/Task.php index e4d58a933a734..b8d7175856d14 100644 --- a/administrator/components/com_scheduler/src/Task/Task.php +++ b/administrator/components/com_scheduler/src/Task/Task.php @@ -333,7 +333,7 @@ public function acquireLock(): bool try { $db->lockTable('#__scheduler_tasks'); $db->setQuery($query)->execute(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return false; } finally { $db->unlockTables(); @@ -395,7 +395,7 @@ public function releaseLock(bool $update = true): bool try { $db->setQuery($query)->execute(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return false; } @@ -446,7 +446,7 @@ public function skipExecution(): void try { $db->setQuery($query)->execute(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { } $this->set('next_execution', $nextExec); diff --git a/administrator/components/com_scheduler/src/Task/TaskOption.php b/administrator/components/com_scheduler/src/Task/TaskOption.php index d8bc2bd7257f7..4603edac78d29 100644 --- a/administrator/components/com_scheduler/src/Task/TaskOption.php +++ b/administrator/components/com_scheduler/src/Task/TaskOption.php @@ -105,7 +105,7 @@ public function __get(string $name) Log::WARNING, 'deprecated' ); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { // Pass } diff --git a/administrator/components/com_scheduler/src/Traits/TaskPluginTrait.php b/administrator/components/com_scheduler/src/Traits/TaskPluginTrait.php index 01ab8b9d1e0e3..df580462ae658 100644 --- a/administrator/components/com_scheduler/src/Traits/TaskPluginTrait.php +++ b/administrator/components/com_scheduler/src/Traits/TaskPluginTrait.php @@ -143,7 +143,7 @@ public function enhanceTaskItemForm($context, $data = null): bool try { $enhancementFormFile = Path::check($enhancementFormFile); - } catch (\Exception $e) { + } catch (\Exception) { return false; } diff --git a/administrator/components/com_templates/src/Model/TemplateModel.php b/administrator/components/com_templates/src/Model/TemplateModel.php index fe2f998e17d02..41afbd359f715 100644 --- a/administrator/components/com_templates/src/Model/TemplateModel.php +++ b/administrator/components/com_templates/src/Model/TemplateModel.php @@ -764,7 +764,7 @@ public function copy() if (is_file($src)) { try { File::copy($src, $dst); - } catch (FilesystemException $exception) { + } catch (FilesystemException) { } } } @@ -832,7 +832,7 @@ protected function fixTemplateName() try { $result = File::move($file, \dirname($file) . $newFile) && $result; - } catch (FilesystemException $exception) { + } catch (FilesystemException) { $result = false; } } @@ -852,7 +852,7 @@ protected function fixTemplateName() try { $result = File::write($xmlFile, $contents) && $result; - } catch (FilesystemException $exception) { + } catch (FilesystemException) { $result = false; } } @@ -945,7 +945,7 @@ public function &getSource() try { $filePath = Path::check($fileName); - } catch (\Exception $e) { + } catch (\Exception) { $app->enqueueMessage(Text::_('COM_TEMPLATES_ERROR_SOURCE_FILE_NOT_FOUND'), 'error'); return; @@ -1028,7 +1028,7 @@ public function save($data) try { File::write($filePath, $data['source']); - } catch (FilesystemException $exception) { + } catch (FilesystemException) { $app->enqueueMessage(Text::sprintf('COM_TEMPLATES_ERROR_FAILED_TO_SAVE_FILENAME', $fileName), 'error'); return false; @@ -1282,7 +1282,7 @@ public function createTemplateOverride($overridePath, $htmlPath) try { $return = File::copy($file, $htmlFilePath, '', true); - } catch (FilesystemException $exception) { + } catch (FilesystemException) { $return = false; } } @@ -1307,7 +1307,7 @@ public function deleteFile($file) try { $return = File::delete($filePath); - } catch (FilesystemException $exception) { + } catch (FilesystemException) { $return = false; } @@ -1398,7 +1398,7 @@ public function uploadFile($file, $location) try { File::upload($file['tmp_name'], Path::clean($path . '/' . $location . '/' . $fileName)); - } catch (FilesystemException $exception) { + } catch (FilesystemException) { $app->enqueueMessage(Text::_('COM_TEMPLATES_FILE_UPLOAD_ERROR'), 'error'); return false; @@ -1759,7 +1759,7 @@ public function copyFile($newName, $location, $file) try { File::copy($path . $relPath, $newPath); - } catch (FilesystemException $exception) { + } catch (FilesystemException) { return false; } @@ -1995,7 +1995,7 @@ public function child() try { $xml = simplexml_load_string(file_get_contents($xmlFile)); - } catch (\Exception $e) { + } catch (\Exception) { $app->enqueueMessage(Text::_('COM_TEMPLATES_ERROR_COULD_NOT_READ'), 'error'); return false; @@ -2059,7 +2059,7 @@ public function child() try { $result = File::write($xmlFile, $dom->saveXML()); - } catch (FilesystemException $exception) { + } catch (FilesystemException) { $app->enqueueMessage(Text::_('COM_TEMPLATES_ERROR_COULD_NOT_WRITE'), 'error'); return false; @@ -2139,7 +2139,7 @@ public function copyStyles() try { $parentStyle = $db->loadObjectList(); - } catch (\Exception $e) { + } catch (\Exception) { $app->enqueueMessage(Text::_('COM_TEMPLATES_ERROR_STYLE_NOT_FOUND'), 'error'); return false; @@ -2162,7 +2162,7 @@ public function copyStyles() try { $db->execute(); - } catch (\Exception $e) { + } catch (\Exception) { $app->enqueueMessage(Text::_('COM_TEMPLATES_ERROR_COULD_NOT_READ'), 'error'); return false; diff --git a/administrator/components/com_templates/src/View/Template/HtmlView.php b/administrator/components/com_templates/src/View/Template/HtmlView.php index 61f49154a0bdb..26ba08b6ec2b0 100644 --- a/administrator/components/com_templates/src/View/Template/HtmlView.php +++ b/administrator/components/com_templates/src/View/Template/HtmlView.php @@ -191,7 +191,7 @@ public function display($tpl = null) try { $this->image = $model->getImage(); $this->type = 'image'; - } catch (\RuntimeException $exception) { + } catch (\RuntimeException) { $app->enqueueMessage(Text::_('COM_TEMPLATES_GD_EXTENSION_NOT_AVAILABLE')); $this->type = 'home'; } diff --git a/administrator/components/com_users/src/Controller/CaptiveController.php b/administrator/components/com_users/src/Controller/CaptiveController.php index c457c4ac2db55..3d47fda0f1c0b 100644 --- a/administrator/components/com_users/src/Controller/CaptiveController.php +++ b/administrator/components/com_users/src/Controller/CaptiveController.php @@ -107,7 +107,7 @@ public function display($cachable = false, $urlparams = false): void try { // Suppress all modules on the page except those explicitly allowed $model->suppressAllModules(); - } catch (\Exception $e) { + } catch (\Exception) { // If we can't kill the modules we can still survive. } diff --git a/administrator/components/com_users/src/Helper/Mfa.php b/administrator/components/com_users/src/Helper/Mfa.php index 100d9f8674814..f102a580c206d 100644 --- a/administrator/components/com_users/src/Helper/Mfa.php +++ b/administrator/components/com_users/src/Helper/Mfa.php @@ -272,7 +272,7 @@ public static function getUserMfaRecords(?int $userId): array try { $ids = $db->setQuery($query)->loadColumn() ?: []; - } catch (\Exception $e) { + } catch (\Exception) { $ids = []; } diff --git a/administrator/components/com_users/src/Model/MethodsModel.php b/administrator/components/com_users/src/Model/MethodsModel.php index 26cc80e566330..0efe426b28c1c 100644 --- a/administrator/components/com_users/src/Model/MethodsModel.php +++ b/administrator/components/com_users/src/Model/MethodsModel.php @@ -197,7 +197,7 @@ public function setFlag(User $user, bool $flag = true): void try { $result = $db->setQuery($query)->loadResult(); - } catch (\Exception $e) { + } catch (\Exception) { return; } diff --git a/administrator/components/com_users/src/Model/UsersModel.php b/administrator/components/com_users/src/Model/UsersModel.php index 4c7ba76416b18..b5a2117aa5bb5 100644 --- a/administrator/components/com_users/src/Model/UsersModel.php +++ b/administrator/components/com_users/src/Model/UsersModel.php @@ -598,7 +598,7 @@ protected function getUserDisplayedGroups($userId) try { $result = $db->setQuery($query)->loadColumn(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { $result = []; } diff --git a/administrator/components/com_users/src/Service/Encrypt.php b/administrator/components/com_users/src/Service/Encrypt.php index a15f452662b89..ef38b5e66b2b5 100644 --- a/administrator/components/com_users/src/Service/Encrypt.php +++ b/administrator/components/com_users/src/Service/Encrypt.php @@ -125,7 +125,7 @@ private function getPassword(): string { try { return Factory::getApplication()->get('secret', ''); - } catch (\Exception $e) { + } catch (\Exception) { return ''; } } diff --git a/administrator/components/com_users/src/View/SiteTemplateTrait.php b/administrator/components/com_users/src/View/SiteTemplateTrait.php index f474139c81eae..9e064b67b9775 100644 --- a/administrator/components/com_users/src/View/SiteTemplateTrait.php +++ b/administrator/components/com_users/src/View/SiteTemplateTrait.php @@ -53,7 +53,7 @@ private function setSiteTemplateStyle(): void $refTemplate = $refApp->getProperty('template'); $refTemplate->setAccessible(true); $refTemplate->setValue($app, null); - } catch (\ReflectionException $e) { + } catch (\ReflectionException) { return; } diff --git a/administrator/components/com_users/src/View/User/HtmlView.php b/administrator/components/com_users/src/View/User/HtmlView.php index 67169b7f7a1b3..b361d18ae1ccc 100644 --- a/administrator/components/com_users/src/View/User/HtmlView.php +++ b/administrator/components/com_users/src/View/User/HtmlView.php @@ -135,7 +135,7 @@ public function display($tpl = null) $this->mfaConfigurationUI = Mfa::canShowConfigurationInterface($userBeingEdited) ? Mfa::getConfigurationInterface($userBeingEdited) : ''; - } catch (\Exception $e) { + } catch (\Exception) { // In case something goes really wrong with the plugins; prevents hard breaks. $this->mfaConfigurationUI = null; } diff --git a/components/com_banners/src/Model/BannerModel.php b/components/com_banners/src/Model/BannerModel.php index c54a26c3996fe..d1f9e469d5755 100644 --- a/components/com_banners/src/Model/BannerModel.php +++ b/components/com_banners/src/Model/BannerModel.php @@ -193,7 +193,7 @@ public function &getItem() try { $this->_item = $cache->get($loader, [$id], md5(__METHOD__ . $id)); - } catch (CacheExceptionInterface $e) { + } catch (CacheExceptionInterface) { $this->_item = $loader($id); } } diff --git a/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php b/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php index 44989aa2d1123..3d110b3718114 100644 --- a/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php +++ b/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php @@ -180,9 +180,9 @@ public function display($tpl = null) try { $feed = new FeedFactory(); $this->rssDoc = $feed->getFeed($item->link); - } catch (\InvalidArgumentException $e) { + } catch (\InvalidArgumentException) { $msg = Text::_('COM_NEWSFEEDS_ERRORS_FEED_NOT_RETRIEVED'); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { $msg = Text::_('COM_NEWSFEEDS_ERRORS_FEED_NOT_RETRIEVED'); } diff --git a/components/com_privacy/src/Model/ConfirmModel.php b/components/com_privacy/src/Model/ConfirmModel.php index 609001b39d2f7..3b911bff39e43 100644 --- a/components/com_privacy/src/Model/ConfirmModel.php +++ b/components/com_privacy/src/Model/ConfirmModel.php @@ -105,7 +105,7 @@ public function confirmRequest($data) try { $table->store(); - } catch (ExecutionFailureException $exception) { + } catch (ExecutionFailureException) { // The error will be logged in the database API, we just need to catch it here to not let things fatal out } diff --git a/components/com_privacy/src/Model/RemindModel.php b/components/com_privacy/src/Model/RemindModel.php index f3f5d8c8ed3a4..5df7813986413 100644 --- a/components/com_privacy/src/Model/RemindModel.php +++ b/components/com_privacy/src/Model/RemindModel.php @@ -85,7 +85,7 @@ public function remindRequest($data) try { $remind = $db->loadObject(); - } catch (ExecutionFailureException $e) { + } catch (ExecutionFailureException) { $this->setError(Text::_('COM_PRIVACY_ERROR_NO_PENDING_REMIND')); return false; diff --git a/components/com_users/src/Model/LoginModel.php b/components/com_users/src/Model/LoginModel.php index cb40409e8837a..0d9780ebc3b2b 100644 --- a/components/com_users/src/Model/LoginModel.php +++ b/components/com_users/src/Model/LoginModel.php @@ -148,7 +148,7 @@ public function getMenuLanguage(int $id): string try { return $db->loadResult(); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return ''; } }