diff --git a/administrator/components/com_associations/src/Model/AssociationsModel.php b/administrator/components/com_associations/src/Model/AssociationsModel.php index 8748cc4f3ba8f..c0cffcc55f771 100644 --- a/administrator/components/com_associations/src/Model/AssociationsModel.php +++ b/administrator/components/com_associations/src/Model/AssociationsModel.php @@ -328,7 +328,7 @@ protected function getListQuery() } // If component item type supports access level, select the access level also. - if (\array_key_exists('acl', $support) && $support['acl'] == true && !empty($fields['access'])) { + if (\array_key_exists('acl', $support) && $support['acl'] && !empty($fields['access'])) { $query->select($db->quoteName($fields['access'], 'access')); // Join over the access levels. diff --git a/administrator/components/com_categories/src/Model/CategoriesModel.php b/administrator/components/com_categories/src/Model/CategoriesModel.php index defbc31c0aa84..a2e7a2c6a0de0 100644 --- a/administrator/components/com_categories/src/Model/CategoriesModel.php +++ b/administrator/components/com_categories/src/Model/CategoriesModel.php @@ -455,7 +455,7 @@ public function getItems() { $items = parent::getItems(); - if ($items != false) { + if ($items) { $extension = $this->getState('filter.extension'); $this->countItems($items, $extension); diff --git a/administrator/components/com_config/src/Model/ApplicationModel.php b/administrator/components/com_config/src/Model/ApplicationModel.php index 8100c81dca18a..88f218cd15630 100644 --- a/administrator/components/com_config/src/Model/ApplicationModel.php +++ b/administrator/components/com_config/src/Model/ApplicationModel.php @@ -585,11 +585,11 @@ public function save($data) } // Give a warning if the cache-folder can not be opened - if ($data['caching'] > 0 && $data['cache_handler'] == 'file' && @opendir($path) == false) { + if ($data['caching'] > 0 && $data['cache_handler'] == 'file' && @opendir($path) === false) { $error = true; // If a custom path is in use, try using the system default instead of disabling cache - if ($path !== JPATH_CACHE && @opendir(JPATH_CACHE) != false) { + if ($path !== JPATH_CACHE && @opendir(JPATH_CACHE) !== false) { try { Log::add( Text::sprintf('COM_CONFIG_ERROR_CUSTOM_CACHE_PATH_NOTWRITABLE_USING_DEFAULT', $path, JPATH_CACHE), diff --git a/administrator/components/com_content/src/Model/ArticleModel.php b/administrator/components/com_content/src/Model/ArticleModel.php index 46f4bca0be414..e6830f501b9e5 100644 --- a/administrator/components/com_content/src/Model/ArticleModel.php +++ b/administrator/components/com_content/src/Model/ArticleModel.php @@ -708,7 +708,7 @@ public function save($data) $check = $input->post->get('jform', [], 'array'); foreach ($data['urls'] as $i => $url) { - if ($url != false && ($i == 'urla' || $i == 'urlb' || $i == 'urlc')) { + if (trim($url) !== '' && ($i == 'urla' || $i == 'urlb' || $i == 'urlc')) { if (preg_match('~^#[a-zA-Z]{1}[a-zA-Z0-9-_:.]*$~', $check['urls'][$i]) == 1) { $data['urls'][$i] = $check['urls'][$i]; } else { diff --git a/administrator/components/com_finder/src/Service/HTML/Query.php b/administrator/components/com_finder/src/Service/HTML/Query.php index 2f2a6ffaafa50..bdb1c1f99ee6f 100644 --- a/administrator/components/com_finder/src/Service/HTML/Query.php +++ b/administrator/components/com_finder/src/Service/HTML/Query.php @@ -41,14 +41,14 @@ public static function explained(IndexerQuery $query) // Process the required tokens. foreach ($query->included as $token) { - if ($token->required && (!isset($token->derived) || $token->derived == false)) { + if ($token->required && (!isset($token->derived) || !$token->derived)) { $parts[] = '' . Text::sprintf('COM_FINDER_QUERY_TOKEN_REQUIRED', $token->term) . ''; } } // Process the optional tokens. foreach ($query->included as $token) { - if (!$token->required && (!isset($token->derived) || $token->derived == false)) { + if (!$token->required && (!isset($token->derived) || !$token->derived)) { $parts[] = '' . Text::sprintf('COM_FINDER_QUERY_TOKEN_OPTIONAL', $token->term) . ''; } } diff --git a/administrator/components/com_installer/src/Model/UpdateModel.php b/administrator/components/com_installer/src/Model/UpdateModel.php index 46fb9900603c7..208bb14d18b97 100644 --- a/administrator/components/com_installer/src/Model/UpdateModel.php +++ b/administrator/components/com_installer/src/Model/UpdateModel.php @@ -533,13 +533,6 @@ public function getForm($data = [], $loadData = true) Form::addFieldPath(JPATH_COMPONENT . '/models/fields'); $form = Form::getInstance('com_installer.update', 'update', ['load_data' => $loadData]); - // Check for an error. - if ($form == false) { - $this->setError($form->getMessage()); - - return false; - } - // Check the session for previously entered form data. $data = $this->loadFormData(); diff --git a/administrator/components/com_menus/src/Field/MenuItemByTypeField.php b/administrator/components/com_menus/src/Field/MenuItemByTypeField.php index c15ee03133574..b61f54500888f 100644 --- a/administrator/components/com_menus/src/Field/MenuItemByTypeField.php +++ b/administrator/components/com_menus/src/Field/MenuItemByTypeField.php @@ -149,7 +149,7 @@ public function setup(\SimpleXMLElement $element, $value, $group = null) { $result = parent::setup($element, $value, $group); - if ($result == true) { + if ($result) { $menuType = (string) $this->element['menu_type']; if (!$menuType) { diff --git a/administrator/components/com_menus/src/Model/ItemModel.php b/administrator/components/com_menus/src/Model/ItemModel.php index 3b4d4ba88d0d0..2d46b9df704d1 100644 --- a/administrator/components/com_menus/src/Model/ItemModel.php +++ b/administrator/components/com_menus/src/Model/ItemModel.php @@ -1146,7 +1146,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content') // If an XML file was found in the component, load it first. // We need to qualify the full path to avoid collisions with component file names. - if ($form->loadFile($formFile, true, '/metadata') == false) { + if (!$form->loadFile($formFile, true, '/metadata')) { throw new \Exception(Text::_('JERROR_LOADFILE_FAILED')); } diff --git a/administrator/components/com_redirect/src/Model/LinkModel.php b/administrator/components/com_redirect/src/Model/LinkModel.php index c982c0bf1c462..69af0758524a1 100644 --- a/administrator/components/com_redirect/src/Model/LinkModel.php +++ b/administrator/components/com_redirect/src/Model/LinkModel.php @@ -72,7 +72,7 @@ public function getForm($data = [], $loadData = true) } // Modify the form based on access controls. - if ($this->canEditState((object) $data) != true) { + if (!$this->canEditState((object)$data)) { // Disable fields for display. $form->setFieldAttribute('published', 'disabled', 'true'); @@ -83,7 +83,7 @@ public function getForm($data = [], $loadData = true) // If in advanced mode then we make sure the new URL field is not compulsory and the header // field compulsory in case people select non-3xx redirects - if (ComponentHelper::getParams('com_redirect')->get('mode', 0) == true) { + if (ComponentHelper::getParams('com_redirect')->get('mode', 0)) { $form->setFieldAttribute('new_url', 'required', 'false'); $form->setFieldAttribute('header', 'required', 'true'); } diff --git a/administrator/components/com_redirect/src/Table/LinkTable.php b/administrator/components/com_redirect/src/Table/LinkTable.php index 926d352fea1a2..067f7ffad030e 100644 --- a/administrator/components/com_redirect/src/Table/LinkTable.php +++ b/administrator/components/com_redirect/src/Table/LinkTable.php @@ -74,13 +74,13 @@ public function check() } // Check for valid name if not in advanced mode. - if (empty($this->new_url) && ComponentHelper::getParams('com_redirect')->get('mode', 0) == false) { + if (empty($this->new_url) && !ComponentHelper::getParams('com_redirect')->get('mode', 0)) { $this->setError(Text::_('COM_REDIRECT_ERROR_DESTINATION_URL_REQUIRED')); return false; } - if (empty($this->new_url) && ComponentHelper::getParams('com_redirect')->get('mode', 0) == true) { + if (empty($this->new_url) && ComponentHelper::getParams('com_redirect')->get('mode', 0)) { // Else if an empty URL and in redirect mode only throw the same error if the code is a 3xx status code if ($this->header < 400 && $this->header >= 300) { $this->setError(Text::_('COM_REDIRECT_ERROR_DESTINATION_URL_REQUIRED')); diff --git a/administrator/components/com_tags/src/Model/TagsModel.php b/administrator/components/com_tags/src/Model/TagsModel.php index b80b86fc8cd63..2dde7f9b3a5e6 100644 --- a/administrator/components/com_tags/src/Model/TagsModel.php +++ b/administrator/components/com_tags/src/Model/TagsModel.php @@ -275,7 +275,7 @@ public function getItems() { $items = parent::getItems(); - if ($items != false) { + if ($items) { $extension = $this->getState('filter.extension', ''); $this->countItems($items, $extension); diff --git a/administrator/components/com_templates/src/Controller/TemplateController.php b/administrator/components/com_templates/src/Controller/TemplateController.php index 6a45658344ba7..619aaa6b65f2f 100644 --- a/administrator/components/com_templates/src/Controller/TemplateController.php +++ b/administrator/components/com_templates/src/Controller/TemplateController.php @@ -630,7 +630,7 @@ public function deleteFolder() } elseif ($model->deleteFolder($location)) { $this->setMessage(Text::_('COM_TEMPLATES_FOLDER_DELETE_SUCCESS')); - if (stristr(base64_decode($file), $location) != false) { + if (stristr(base64_decode($file), $location)) { $file = base64_encode('home'); } diff --git a/administrator/components/com_templates/src/Helper/TemplateHelper.php b/administrator/components/com_templates/src/Helper/TemplateHelper.php index 9f30dcf6c85b6..2b1297e2c111b 100644 --- a/administrator/components/com_templates/src/Helper/TemplateHelper.php +++ b/administrator/components/com_templates/src/Helper/TemplateHelper.php @@ -98,7 +98,7 @@ public static function canUpload($file, $err = '') $allowable = array_merge($imageTypes, $sourceTypes, $fontTypes, $archiveTypes); - if ($format == '' || $format == false || (!\in_array($format, $allowable))) { + if ($format === '' || !\in_array($format, $allowable)) { $app = Factory::getApplication(); $app->enqueueMessage(Text::_('COM_TEMPLATES_ERROR_WARNFILETYPE'), 'error'); diff --git a/administrator/components/com_templates/src/Model/TemplateModel.php b/administrator/components/com_templates/src/Model/TemplateModel.php index 4f0a1724995e5..23eb1bbe12aac 100644 --- a/administrator/components/com_templates/src/Model/TemplateModel.php +++ b/administrator/components/com_templates/src/Model/TemplateModel.php @@ -1174,9 +1174,9 @@ public function createOverride($override) $name = end($explodeArray); $client = ApplicationHelper::getClientInfo($template->client_id); - if (stristr($name, 'mod_') != false) { + if (stristr($name, 'mod_') !== false) { $htmlPath = Path::clean($client->path . '/templates/' . $template->element . '/html/' . $name); - } elseif (stristr($override, 'com_') != false) { + } elseif (stristr($override, 'com_') !== false) { $size = \count($explodeArray); $url = Path::clean($explodeArray[$size - 3] . '/' . $explodeArray[$size - 1]); @@ -1202,9 +1202,9 @@ public function createOverride($override) return false; } - if (stristr($name, 'mod_') != false) { + if (stristr($name, 'mod_') !== false) { $return = $this->createTemplateOverride(Path::clean($override . '/tmpl'), $htmlPath); - } elseif (stristr($override, 'com_') != false && stristr($override, 'layouts') == false) { + } elseif (stristr($override, 'com_') !== false && stristr($override, 'layouts') === false) { $path = $override . '/tmpl'; // View can also be in the top level folder @@ -1703,7 +1703,7 @@ public function getFont() $fileName = end($explodeArray); $path = $this->getBasePath() . base64_decode($app->getInput()->get('file')); - if (stristr($client->path, 'administrator') == false) { + if (stristr($client->path, 'administrator') === false) { $folder = '/templates/'; } else { $folder = '/administrator/templates/'; diff --git a/administrator/modules/mod_feed/tmpl/default.php b/administrator/modules/mod_feed/tmpl/default.php index 4a547a3c2f2f3..0ed70c2c0d4d3 100644 --- a/administrator/modules/mod_feed/tmpl/default.php +++ b/administrator/modules/mod_feed/tmpl/default.php @@ -43,7 +43,7 @@ $direction = ' redirect-rtl'; } - if ($feed != false) : + if ($feed) : ?>
send(); // If we are supposed to copy the sender, do so. - if ($emailCopyToSender == true && !empty($data['contact_email_copy'])) { + if ($emailCopyToSender && !empty($data['contact_email_copy'])) { $mailer = new MailTemplate('com_contact.mail.copy', $app->getLanguage()->getTag()); $mailer->addRecipient($templateData['email']); $mailer->setReplyTo($templateData['email'], $templateData['name']); diff --git a/api/components/com_privacy/src/View/Requests/JsonapiView.php b/api/components/com_privacy/src/View/Requests/JsonapiView.php index d4b8caf68397c..4b2987b48b874 100644 --- a/api/components/com_privacy/src/View/Requests/JsonapiView.php +++ b/api/components/com_privacy/src/View/Requests/JsonapiView.php @@ -58,7 +58,7 @@ public function export() $exportData = $model->collectDataForExportRequest(); - if ($exportData == false) { + if (!$exportData) { throw new RouteNotFoundException('Item does not exist'); } diff --git a/components/com_contact/src/Controller/ContactController.php b/components/com_contact/src/Controller/ContactController.php index d8b04fe06716a..520ad430814a5 100644 --- a/components/com_contact/src/Controller/ContactController.php +++ b/components/com_contact/src/Controller/ContactController.php @@ -287,7 +287,7 @@ private function _sendEmail($data, $contact, $emailCopyToSender) $sent = $mailer->send(); // If we are supposed to copy the sender, do so. - if ($emailCopyToSender == true && !empty($data['contact_email_copy'])) { + if ($emailCopyToSender && !empty($data['contact_email_copy'])) { $mailer = new MailTemplate('com_contact.mail.copy', $app->getLanguage()->getTag()); $mailer->addRecipient($templateData['email']); $mailer->setReplyTo($templateData['email'], $templateData['name']); diff --git a/components/com_content/src/Model/FeaturedModel.php b/components/com_content/src/Model/FeaturedModel.php index 82771831000d1..2473a9d687959 100644 --- a/components/com_content/src/Model/FeaturedModel.php +++ b/components/com_content/src/Model/FeaturedModel.php @@ -93,7 +93,7 @@ protected function populateState($ordering = null, $direction = null) } // Check for category selection - if ($params->get('featured_categories') && implode(',', $params->get('featured_categories')) == true) { + if ($params->get('featured_categories') && implode(',', $params->get('featured_categories'))) { $featuredCategories = $params->get('featured_categories'); $this->setState('filter.frontpage.categories', $featuredCategories); } diff --git a/components/com_content/src/View/Article/HtmlView.php b/components/com_content/src/View/Article/HtmlView.php index 1287500b69a2a..238bd23c33f74 100644 --- a/components/com_content/src/View/Article/HtmlView.php +++ b/components/com_content/src/View/Article/HtmlView.php @@ -179,7 +179,7 @@ public function display($tpl = null) $offset = (int) $this->state->get('list.offset'); // Check the view access to the article (the model has already computed the values). - if ($item->params->get('access-view') == false && ($item->params->get('show_noauth', '0') == '0')) { + if (!$item->params->get('access-view') && ($item->params->get('show_noauth', '0') == '0')) { $app->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'), 'error'); $app->setHeader('status', 403, true); @@ -192,7 +192,7 @@ public function display($tpl = null) * - Deny access to logged users with 403 code * NOTE: we do not recheck for no access-view + show_noauth disabled ... since it was checked above */ - if ($item->params->get('access-view') == false && !\strlen($item->fulltext)) { + if (!$item->params->get('access-view') && !\strlen($item->fulltext)) { if ($this->user->guest) { $return = base64_encode(Uri::getInstance()); $login_url_with_return = Route::_('index.php?option=com_users&view=login&return=' . $return); diff --git a/components/com_content/tmpl/article/default.php b/components/com_content/tmpl/article/default.php index 98782149a9d97..255dc31ec14e8 100644 --- a/components/com_content/tmpl/article/default.php +++ b/components/com_content/tmpl/article/default.php @@ -122,7 +122,7 @@ loadTemplate('links'); ?> - get('show_noauth') == true && $user->guest) : ?> + get('show_noauth') && $user->guest) : ?> item); ?> item->introtext); ?> diff --git a/components/com_content/tmpl/category/default_articles.php b/components/com_content/tmpl/category/default_articles.php index b5d1fa498b5a4..276f8bd6191b5 100644 --- a/components/com_content/tmpl/category/default_articles.php +++ b/components/com_content/tmpl/category/default_articles.php @@ -257,7 +257,7 @@ author) || !empty($article->created_by_alias)) : ?> author ?> created_by_alias ?: $author; ?> - contact_link) && $this->params->get('link_author') == true) : ?> + contact_link) && $this->params->get('link_author')) : ?> params->get('show_headings')) : ?> contact_link, $author); ?> diff --git a/components/com_tags/tmpl/tags/default_items.php b/components/com_tags/tmpl/tags/default_items.php index bfaf660b218ff..c5e714c33c1b5 100644 --- a/components/com_tags/tmpl/tags/default_items.php +++ b/components/com_tags/tmpl/tags/default_items.php @@ -80,7 +80,7 @@ class="inputbox" onchange="document.adminForm.submit();" - items == false || $n === 0) : ?> + items || $n === 0) : ?>
diff --git a/components/com_users/src/Controller/RemindController.php b/components/com_users/src/Controller/RemindController.php index d6a3491bc6d00..95d1b3d825cfc 100644 --- a/components/com_users/src/Controller/RemindController.php +++ b/components/com_users/src/Controller/RemindController.php @@ -45,7 +45,7 @@ public function remind() $return = $model->processRemindRequest($data); // Check for a hard error. - if ($return == false && JDEBUG) { + if (!$return && JDEBUG) { // The request failed. // Go back to the request form. $message = Text::sprintf('COM_USERS_REMIND_REQUEST_FAILED', $model->getError()); diff --git a/components/com_users/src/Controller/UserController.php b/components/com_users/src/Controller/UserController.php index 4bf8e41f47136..a59b802bd5bce 100644 --- a/components/com_users/src/Controller/UserController.php +++ b/components/com_users/src/Controller/UserController.php @@ -99,7 +99,7 @@ public function login() } // Success - if ($options['remember'] == true) { + if ($options['remember']) { $this->app->setUserState('rememberLogin', true); } diff --git a/layouts/joomla/content/info_block/author.php b/layouts/joomla/content/info_block/author.php index 53b8af327c041..1aa65f97c6144 100644 --- a/layouts/joomla/content/info_block/author.php +++ b/layouts/joomla/content/info_block/author.php @@ -18,7 +18,7 @@ created_by_alias ?: $displayData['item']->author); ?> ' . $author . ''; ?> - contact_link) && $displayData['params']->get('link_author') == true) : ?> + contact_link) && $displayData['params']->get('link_author')) : ?> contact_link, $author)); ?> diff --git a/libraries/src/Application/CLI/ColorStyle.php b/libraries/src/Application/CLI/ColorStyle.php index 9bf56abb5cf07..76166bfd5a0eb 100644 --- a/libraries/src/Application/CLI/ColorStyle.php +++ b/libraries/src/Application/CLI/ColorStyle.php @@ -106,7 +106,7 @@ final class ColorStyle public function __construct(string $fg = '', string $bg = '', array $options = []) { if ($fg) { - if (\array_key_exists($fg, static::$knownColors) == false) { + if (!\array_key_exists($fg, static::$knownColors)) { throw new \InvalidArgumentException( \sprintf( 'Invalid foreground color "%1$s" [%2$s]', @@ -120,7 +120,7 @@ public function __construct(string $fg = '', string $bg = '', array $options = [ } if ($bg) { - if (\array_key_exists($bg, static::$knownColors) == false) { + if (!\array_key_exists($bg, static::$knownColors)) { throw new \InvalidArgumentException( \sprintf( 'Invalid background color "%1$s" [%2$s]', @@ -134,7 +134,7 @@ public function __construct(string $fg = '', string $bg = '', array $options = [ } foreach ($options as $option) { - if (\array_key_exists($option, static::$knownOptions) == false) { + if (!\array_key_exists($option, static::$knownOptions)) { throw new \InvalidArgumentException( \sprintf( 'Invalid option "%1$s" [%2$s]', diff --git a/libraries/src/Application/CMSApplication.php b/libraries/src/Application/CMSApplication.php index 2d6a730c72add..3dcec60b661be 100644 --- a/libraries/src/Application/CMSApplication.php +++ b/libraries/src/Application/CMSApplication.php @@ -955,7 +955,7 @@ public function login($credentials, $options = []) $user->cookieLogin = true; } - if (\in_array(false, $results, true) == false) { + if (!\in_array(false, $results, true)) { $options['user'] = $user; $options['responseType'] = $response->type; diff --git a/libraries/src/Cache/Cache.php b/libraries/src/Cache/Cache.php index eb9de4a46ee9f..cef3fa92bfe8b 100644 --- a/libraries/src/Cache/Cache.php +++ b/libraries/src/Cache/Cache.php @@ -380,7 +380,7 @@ public function lock($id, $group = null, $locktime = null) */ $handler = $this->_getStorage(); - if ($this->_options['locking'] == true) { + if ($this->_options['locking']) { $locked = $handler->lock($id, $group, $locktime); if ($locked !== false) { @@ -397,7 +397,7 @@ public function lock($id, $group = null, $locktime = null) $looptime = $locktime * 10; $id2 = $id . '_lock'; - if ($this->_options['locking'] == true) { + if ($this->_options['locking']) { $data_lock = $handler->get($id2, $group, $this->_options['checkTime']); } else { $data_lock = false; @@ -421,7 +421,7 @@ public function lock($id, $group = null, $locktime = null) } } - if ($this->_options['locking'] == true) { + if ($this->_options['locking']) { $returning->locked = $handler->store($id2, $group, 1); } diff --git a/libraries/src/Cache/Storage/FileStorage.php b/libraries/src/Cache/Storage/FileStorage.php index 5b6e2d4568576..38891486bd322 100644 --- a/libraries/src/Cache/Storage/FileStorage.php +++ b/libraries/src/Cache/Storage/FileStorage.php @@ -110,7 +110,7 @@ public function get($id, $group, $checkTime = true) $path = $this->_getFilePath($id, $group); $close = false; - if ($checkTime == false || ($checkTime == true && $this->_checkExpire($id, $group) === true)) { + if (!$checkTime || ($checkTime && $this->_checkExpire($id, $group))) { if (file_exists($path)) { if (isset($this->_locked_files[$path])) { $_fileopen = $this->_locked_files[$path]; diff --git a/libraries/src/Cache/Storage/RedisStorage.php b/libraries/src/Cache/Storage/RedisStorage.php index 112382e4fcaca..19a352c4ee62e 100644 --- a/libraries/src/Cache/Storage/RedisStorage.php +++ b/libraries/src/Cache/Storage/RedisStorage.php @@ -67,7 +67,7 @@ public function __construct($options = []) */ protected function getConnection() { - if (static::isSupported() == false) { + if (!static::isSupported()) { return false; } @@ -100,7 +100,7 @@ protected function getConnection() Log::add($e->getMessage(), Log::DEBUG); } - if ($connection == false) { + if (!$connection) { static::$_redis = null; throw new CacheConnectingException('Redis connection failed', 500); @@ -121,7 +121,7 @@ protected function getConnection() $select = static::$_redis->select($server['db']); - if ($select == false) { + if (!$select) { static::$_redis = null; throw new CacheConnectingException('Redis failed to select database', 500); @@ -150,7 +150,7 @@ protected function getConnection() */ public function contains($id, $group) { - if (static::isConnected() == false) { + if (!static::isConnected()) { return false; } @@ -171,7 +171,7 @@ public function contains($id, $group) */ public function get($id, $group, $checkTime = true) { - if (static::isConnected() == false) { + if (!static::isConnected()) { return false; } @@ -187,7 +187,7 @@ public function get($id, $group, $checkTime = true) */ public function getAll() { - if (static::isConnected() == false) { + if (!static::isConnected()) { return false; } @@ -230,7 +230,7 @@ public function getAll() */ public function store($id, $group, $data) { - if (static::isConnected() == false) { + if (!static::isConnected()) { return false; } @@ -251,7 +251,7 @@ public function store($id, $group, $data) */ public function remove($id, $group) { - if (static::isConnected() == false) { + if (!static::isConnected()) { return false; } @@ -273,7 +273,7 @@ public function remove($id, $group) */ public function clean($group, $mode = null) { - if (static::isConnected() == false) { + if (!static::isConnected()) { return false; } diff --git a/libraries/src/Client/ClientHelper.php b/libraries/src/Client/ClientHelper.php index 0095285ee5e4e..76186c32338b4 100644 --- a/libraries/src/Client/ClientHelper.php +++ b/libraries/src/Client/ClientHelper.php @@ -62,7 +62,7 @@ public static function getCredentials($client, $force = false) } // If user and pass are not set in global config lets see if they are in the session - if ($options['enabled'] == true && ($options['user'] == '' || $options['pass'] == '')) { + if ($options['enabled'] && ($options['user'] == '' || $options['pass'] == '')) { $session = Factory::getSession(); $options['user'] = $session->get($client . '.user', null, 'JClientHelper'); $options['pass'] = $session->get($client . '.pass', null, 'JClientHelper'); @@ -159,7 +159,7 @@ public static function hasCredentials($client) break; } - if ($options['enabled'] == false) { + if (!$options['enabled']) { // The client is disabled in global config, so let's pretend we are OK $return = true; } elseif ($options['user'] != '' && $options['pass'] != '') { diff --git a/libraries/src/Client/FtpClient.php b/libraries/src/Client/FtpClient.php index 28be94171e137..96b46a12dd1b9 100644 --- a/libraries/src/Client/FtpClient.php +++ b/libraries/src/Client/FtpClient.php @@ -1423,7 +1423,7 @@ public function listDetails($path = null, $type = 'all') } // Request the file listing - if (!$this->_putCmd(($recurse == true) ? 'LIST -R' : 'LIST' . $path, [150, 125])) { + if (!$this->_putCmd($recurse ? 'LIST -R' : 'LIST' . $path, [150, 125])) { Log::add(Text::sprintf('JLIB_CLIENT_ERROR_FTP_NOT_EXPECTED_RESPONSE_150_125', __METHOD__, $this->_response, $path), Log::WARNING, 'jerror'); @ fclose($this->_dataconn); diff --git a/libraries/src/Date/Date.php b/libraries/src/Date/Date.php index ac1321467eeae..0315aa6cfdd4e 100644 --- a/libraries/src/Date/Date.php +++ b/libraries/src/Date/Date.php @@ -303,7 +303,7 @@ public function format($format, $local = false, $translate = true): string } // If the returned time should not be local use UTC. - if ($local == false) { + if (!$local) { parent::setTimezone(new \DateTimeZone('UTC')); } @@ -329,7 +329,7 @@ public function format($format, $local = false, $translate = true): string } } - if ($local == false && $this->tz !== null) { + if (!$local && $this->tz !== null) { parent::setTimezone($this->tz); } diff --git a/libraries/src/Document/Document.php b/libraries/src/Document/Document.php index 70b5c22e35e1a..b2090cff6577d 100644 --- a/libraries/src/Document/Document.php +++ b/libraries/src/Document/Document.php @@ -444,7 +444,7 @@ public function getMetaData($name, $attribute = 'name') { // B/C old http_equiv parameter. if (!\is_string($attribute)) { - $attribute = $attribute == true ? 'http-equiv' : 'name'; + $attribute = $attribute ? 'http-equiv' : 'name'; } if ($name === 'generator') { @@ -478,7 +478,7 @@ public function setMetaData($name, $content, $attribute = 'name') // B/C old http_equiv parameter. if (!\is_string($attribute)) { - $attribute = $attribute == true ? 'http-equiv' : 'name'; + $attribute = $attribute ? 'http-equiv' : 'name'; } if ($name === 'generator') { diff --git a/libraries/src/Document/HtmlDocument.php b/libraries/src/Document/HtmlDocument.php index 32bbe274dae8b..30818d350173e 100644 --- a/libraries/src/Document/HtmlDocument.php +++ b/libraries/src/Document/HtmlDocument.php @@ -536,7 +536,7 @@ public function getBuffer($type = null, $name = null, $attribs = []) $renderer = $this->loadRenderer($type); - if ($this->_caching == true && $type === 'modules' && $name !== 'debug') { + if ($this->_caching && $type === 'modules' && $name !== 'debug') { /** @var \Joomla\CMS\Document\Renderer\Html\ModulesRenderer $renderer */ /** @var \Joomla\CMS\Cache\Controller\OutputController $cache */ $cache = $this->getCacheControllerFactory()->createCacheController('output', ['defaultgroup' => 'com_modules']); diff --git a/libraries/src/Filesystem/File.php b/libraries/src/Filesystem/File.php index 627c4c2ec97cd..871dee011aa24 100644 --- a/libraries/src/Filesystem/File.php +++ b/libraries/src/Filesystem/File.php @@ -409,7 +409,7 @@ public static function write($file, $buffer, $useStreams = false) // If the destination directory doesn't exist we need to create it if (!file_exists(\dirname($file))) { - if (Folder::create(\dirname($file)) == false) { + if (!Folder::create(\dirname($file))) { return false; } } diff --git a/libraries/src/Filesystem/FilesystemHelper.php b/libraries/src/Filesystem/FilesystemHelper.php index 9d70f3c273e10..e5486d0f41b7b 100644 --- a/libraries/src/Filesystem/FilesystemHelper.php +++ b/libraries/src/Filesystem/FilesystemHelper.php @@ -316,7 +316,7 @@ public static function fileUploadMaxSize($unitOutput = true) $max_size = $upload_max; } - if ($unitOutput == true) { + if ($unitOutput) { $max_size = self::parseSizeUnit($max_size); } diff --git a/libraries/src/Filesystem/Folder.php b/libraries/src/Filesystem/Folder.php index 34f3799f92931..f5b2d0ebc70d3 100644 --- a/libraries/src/Filesystem/Folder.php +++ b/libraries/src/Filesystem/Folder.php @@ -243,7 +243,7 @@ public static function create($path = '', $mode = 0755) } } - if ($inBaseDir == false) { + if (!$inBaseDir) { // Return false for JFolder::create because the path to be created is not in open_basedir Log::add(__METHOD__ . ': ' . Text::_('JLIB_FILESYSTEM_ERROR_FOLDER_PATH'), Log::WARNING, 'jerror'); diff --git a/libraries/src/Form/Field/SpacerField.php b/libraries/src/Form/Field/SpacerField.php index d686ec7c3aaba..e6f9abf7801b7 100644 --- a/libraries/src/Form/Field/SpacerField.php +++ b/libraries/src/Form/Field/SpacerField.php @@ -75,7 +75,7 @@ protected function getLabel() // Build the class for the label. $class = !empty($this->description) ? 'hasPopover' : ''; - $class = $this->required == true ? $class . ' required' : $class; + $class = $this->required ? $class . ' required' : $class; // Add the opening label tag and main attributes attributes. $label .= '