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 .= '