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
2 changes: 1 addition & 1 deletion libraries/src/Access/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ public static function getActionsFromData($data, $xpath = "/access/section[@name
if (\is_string($data)) {
try {
$data = new \SimpleXMLElement($data);
} catch (\Exception $e) {
} catch (\Exception) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Application/CMSApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ public function getCfg($varname, $default = null)
Log::WARNING,
'deprecated'
);
} catch (\RuntimeException $exception) {
} catch (\RuntimeException) {
// Informational log only
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Application/ConsoleApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ protected function populateHttpHost()
*/
try {
$uri = Uri::getInstance($liveSite);
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
$uri = Uri::getInstance('https://joomla.invalid/set/by/console/application');
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Application/DaemonApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ protected function daemonize()
$this->processId = (int) posix_getpid();
$this->parentId = $this->processId;
}
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
Log::add('Unable to fork.', Log::EMERGENCY);

return false;
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Application/EventAware.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function registerEvent($event, callable $handler)
{
try {
$this->getDispatcher()->addListener($event, $handler);
} catch (\UnexpectedValueException $e) {
} catch (\UnexpectedValueException) {
// No dispatcher is registered, don't throw an error (mimics old behavior)
}

Expand Down Expand Up @@ -93,7 +93,7 @@ public function triggerEvent($eventName, $args = [])
{
try {
$dispatcher = $this->getDispatcher();
} catch (\UnexpectedValueException $exception) {
} catch (\UnexpectedValueException) {
$this->getLogger()->error(\sprintf('Dispatcher not set in %s, cannot trigger events.', \get_class($this)));

return [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected function isHandlingMultiFactorAuthentication(): bool
// Multi-factor Authentication checks take place only for logged in users.
try {
$user = $this->getIdentity();
} catch (\Exception $e) {
} catch (\Exception) {
return false;
}

Expand Down Expand Up @@ -255,7 +255,7 @@ private function needsMultiFactorAuthenticationRedirection(): bool
// Make sure we are logged in
try {
$user = $this->getIdentity();
} catch (\Exception $e) {
} catch (\Exception) {
// This would happen if we are in CLI or under an old Joomla! version. Either case is not supported.
return false;
}
Expand Down Expand Up @@ -356,7 +356,7 @@ private function hasRejectedMultiFactorAuthenticationSetup(): bool

try {
$result = $db->setQuery($query)->loadResult();
} catch (\Exception $e) {
} catch (\Exception) {
$result = 1;
}

Expand Down Expand Up @@ -491,7 +491,7 @@ private function decryptLegacyTFAString(string $secret, string $stringToDecrypt)
// Is this already decrypted?
try {
$decrypted = @json_decode($stringToDecrypt, true);
} catch (\Exception $e) {
} catch (\Exception) {
$decrypted = null;
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Cache/CacheController.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static function getInstance($type = 'output', $options = [])

try {
return Factory::getContainer()->get(CacheControllerFactoryInterface::class)->createCacheController($type, $options);
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
$type = strtolower(preg_replace('/[^A-Z0-9_\.-]/i', '', $type));
$class = 'JCacheController' . ucfirst($type);

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Cache/Storage/RedisStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ protected function getConnection()

try {
static::$_redis->ping();
} catch (\RedisException $e) {
} catch (\RedisException) {
static::$_redis = null;

throw new CacheConnectingException('Redis ping failed', 500);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function submit(RequestParameters $params)
$response = $this->http->post(self::SITE_VERIFY_URL, $params->toArray());

return (string) $response->getBody();
} catch (InvalidResponseCodeException $exception) {
} catch (InvalidResponseCodeException) {
return '';
}
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Categories/Categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static function getInstance($extension, $options = [])
if ($component instanceof CategoryServiceInterface) {
$categories = $component->getCategory($options, \count($parts) > 1 ? $parts[1] : '');
}
} catch (SectionNotFoundException $e) {
} catch (SectionNotFoundException) {
$categories = null;
}

Expand Down Expand Up @@ -236,7 +236,7 @@ protected function _load($id)
{
try {
$db = $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);
$db = Factory::getContainer()->get(DatabaseInterface::class);
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Changelog/Changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public function loadFromXml($url)
try {
$http = HttpFactory::getHttp($httpOption);
$response = $http->get($url);
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
$response = null;
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Component/ComponentHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ protected static function load()

try {
static::$components = $cache->get($loader, [], __METHOD__);
} catch (CacheExceptionInterface $e) {
} catch (CacheExceptionInterface) {
static::$components = $loader();
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Console/FinderIndexCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private function configureIO(InputInterface $input, OutputInterface $output): vo

try {
$language = $this->getLanguage();
} catch (\UnexpectedValueException $e) {
} catch (\UnexpectedValueException) {
@trigger_error(\sprintf('Language must be set in 6.0 in %s', __METHOD__), E_USER_DEPRECATED);
$language = Factory::getLanguage();
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Console/SiteCreatePublicFolderCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in

try {
(new PublicFolderGeneratorHelper())->createPublicFolder($this->publicFolder);
} catch (\Exception $e) {
} catch (\Exception) {
return Command::FAILURE;
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Crypt/Cipher/CryptoCipher.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static function isSupported(): bool
\Crypto::RuntimeTest();

return true;
} catch (\CryptoTestFailedException $e) {
} catch (\CryptoTestFailedException) {
return false;
}
}
Expand Down
6 changes: 3 additions & 3 deletions libraries/src/Exception/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function handleUserDeprecatedErrors(int $errorNumber, string $erro
if ($errorNumber === E_USER_DEPRECATED) {
try {
Log::add("$errorMessage - $errorFile - Line $errorLine", Log::WARNING, 'deprecated');
} catch (\Exception $e) {
} catch (\Exception) {
// Silence
}

Expand Down Expand Up @@ -115,7 +115,7 @@ public static function render(\Throwable $error)

try {
$renderer = AbstractRenderer::getRenderer($format);
} catch (\InvalidArgumentException $e) {
} catch (\InvalidArgumentException) {
// Default to the HTML renderer
$renderer = AbstractRenderer::getRenderer('html');
}
Expand Down Expand Up @@ -225,7 +225,7 @@ protected static function logException(\Throwable $error)
Log::CRITICAL,
'error'
);
} catch (\Throwable $e) {
} catch (\Throwable) {
// Logging failed, don't make a stink about it though
}
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Form/Field/ContenttypeField.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function getOptions()

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

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Form/Field/MenuitemField.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ protected function getGroups()

try {
$menuTitle = $db->loadResult();
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
$menuTitle = $menuType;
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Form/Field/SqlField.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ protected function getOptions()

try {
$items = $db->loadObjectList();
} catch (ExecutionFailureException $e) {
} catch (ExecutionFailureException) {
Factory::getApplication()->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
}
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Form/Field/TagField.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ protected function getOptions()

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

Expand All @@ -232,7 +232,7 @@ protected function getOptions()

try {
$options = array_merge($options, $db->loadObjectList());
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
return [];
}
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Form/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ public function load($data, $replace = true, $xpath = null)
if (\is_string($data)) {
try {
$data = new \SimpleXMLElement($data);
} catch (\Exception $e) {
} catch (\Exception) {
return false;
}
}
Expand Down Expand Up @@ -1465,7 +1465,7 @@ protected function loadField($element, $group = null, $value = null)
if ($field instanceof DatabaseAwareInterface) {
try {
$field->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);
$field->setDatabase(Factory::getContainer()->get(DatabaseInterface::class));
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Form/FormField.php
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ public function validate($value, $group = null, ?Registry $input = null)
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 All @@ -1242,7 +1242,7 @@ public function validate($value, $group = null, ?Registry $input = null)
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
2 changes: 1 addition & 1 deletion libraries/src/Form/Rule/CalendarRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function test(\SimpleXMLElement $element, $value, $group = null, ?Registr

try {
return Factory::getDate($value) instanceof Date;
} catch (\Exception $e) {
} catch (\Exception) {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Form/Rule/FilePathRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function test(\SimpleXMLElement $element, $value, $group = null, ?Registr
// Check if $value is a valid path, which includes not allowing to break out of the current path
try {
Path::check($value);
} catch (\Exception $e) {
} catch (\Exception) {
// When there is an exception in the check path this is not valid
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Helper/AuthenticationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static function getLoginButtons(string $formId): array
// Get all the User plugins.
$dispatcher = Factory::getApplication()->getDispatcher();
PluginHelper::importPlugin('user', null, true, $dispatcher);
} catch (\Exception $e) {
} catch (\Exception) {
return [];
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Helper/LibraryHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ protected static function loadLibrary($element)

try {
static::$libraries[$element] = $cache->get($loader, [$element], __METHOD__ . $element);
} catch (CacheExceptionInterface $e) {
} catch (CacheExceptionInterface) {
static::$libraries[$element] = $loader($element);
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Helper/MediaHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static function getMimeType($file, $isImage = false)
$mime = finfo_file($finfo, $file);
finfo_close($finfo);
}
} catch (\Exception $e) {
} catch (\Exception) {
// If we have any kind of error here => false;
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Helper/ModuleHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public static function getLayoutPath($module, $layout = 'default')
$tPath = Path::check(JPATH_THEMES . '/' . $template . '/html/' . $module . '/' . $layout . '.php');
$iPath = Path::check(JPATH_THEMES . '/' . $templateObj->parent . '/html/' . $module . '/' . $layout . '.php');
$bPath = Path::check(JPATH_BASE . '/modules/' . $module . '/tmpl/' . $defaultLayout . '.php');
} catch (\Exception $e) {
} catch (\Exception) {
// On error fallback to the default path
return $dPath;
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Helper/TagsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public static function convertPathsToNames($tags)

try {
$aliasesMapper = $db->loadAssocList('alias');
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
return false;
}

Expand Down Expand Up @@ -1001,7 +1001,7 @@ public static function searchTags($filters = [])

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

Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Installer/Adapter/ComponentAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ protected function _updateMenus($componentId, $clientId = null)
try {
$db->setQuery($query);
$db->execute();
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
return false;
}

Expand Down Expand Up @@ -1369,7 +1369,7 @@ public function refreshManifestCache()

try {
return $this->parent->extension->store();
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
Log::add(Text::_('JLIB_INSTALLER_ERROR_COMP_REFRESH_MANIFEST_CACHE'), Log::WARNING, 'jerror');

return false;
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/Installer/Adapter/FileAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ protected function extensionExistsInSystem($extension = null)

try {
$db->execute();
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
// Install failed, rollback changes - error logged by the installer
return false;
}
Expand Down Expand Up @@ -589,7 +589,7 @@ public function refreshManifestCache()

try {
return $this->parent->extension->store();
} catch (\RuntimeException $e) {
} catch (\RuntimeException) {
Log::add(Text::_('JLIB_INSTALLER_ERROR_PACK_REFRESH_MANIFEST_CACHE'), Log::WARNING, 'jerror');

return false;
Expand Down
Loading