Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public static function loadActionLogPluginsLanguage()

try {
$rows = $db->loadObjectList();
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
$rows = [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ public function addLog($messages, $messageLanguageKey, $context, $userId = 0)
try {
$db->insertObject('#__action_logs', $logMessage);
$loggedMessages[] = $logMessage;
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
// Ignore it
}
}

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
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public function purge()
{
try {
$this->getDatabase()->truncateTable('#__action_logs');
} catch (\Exception $e) {
} catch (\Exception) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions administrator/components/com_cache/src/Model/CacheModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
}
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down
24 changes: 12 additions & 12 deletions administrator/components/com_config/src/Model/ApplicationModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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'
Expand All @@ -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');
}

Expand All @@ -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');
}
}
Expand Down Expand Up @@ -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'
Expand All @@ -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');
}
}
Expand Down Expand Up @@ -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'
Expand All @@ -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');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand All @@ -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');
}

Expand Down Expand Up @@ -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');
}

Expand All @@ -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');
}

Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_fields/src/Model/FieldModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_fields/src/Model/FieldsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

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

try {
$contentMap = $db->loadObjectList();
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
return [];
}

Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_finder/src/Indexer/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function __construct($locale = null)
break;
}
}
} catch (NotFoundException $e) {
} catch (NotFoundException) {
// We don't have a stemmer for the language
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Loading