| ');
$html = preg_replace('/ | ]*>([^<]+)<\/th>/', '\1', $html);
- $html = preg_replace('/ | ]*>([^<]+)<\/td>/', '\1', $html);
- $t = preg_split('/(]*>[^<]+<\/h2>)/', $html, -1, PREG_SPLIT_DELIM_CAPTURE);
+ $html = preg_replace('/]*>([^<]+)<\/td>/', '\1', (string) $html);
+
+ $t = preg_split('/(]*>[^<]+<\/h2>)/', (string) $html, -1, PREG_SPLIT_DELIM_CAPTURE);
$r = [];
$count = \count($t);
$p1 = '([^<]+)<\/info>';
diff --git a/administrator/components/com_admin/src/Service/HTML/Configuration.php b/administrator/components/com_admin/src/Service/HTML/Configuration.php
index bc9058b9f6831..d3a223742c3ea 100644
--- a/administrator/components/com_admin/src/Service/HTML/Configuration.php
+++ b/administrator/components/com_admin/src/Service/HTML/Configuration.php
@@ -40,6 +40,6 @@ public function value($value): string
$value = implode(', ', $value);
}
- return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
+ return htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8');
}
}
diff --git a/administrator/components/com_admin/src/Service/HTML/PhpSetting.php b/administrator/components/com_admin/src/Service/HTML/PhpSetting.php
index c1f18f44a8616..7bd4344493fb3 100644
--- a/administrator/components/com_admin/src/Service/HTML/PhpSetting.php
+++ b/administrator/components/com_admin/src/Service/HTML/PhpSetting.php
@@ -56,6 +56,6 @@ public function set($val)
*/
public function string($val)
{
- return !empty($val) ? $val : Text::_('JNONE');
+ return empty($val) ? Text::_('JNONE') : $val;
}
}
diff --git a/administrator/components/com_admin/src/Service/HTML/System.php b/administrator/components/com_admin/src/Service/HTML/System.php
index a2b3c369a8cef..1f173df359e58 100644
--- a/administrator/components/com_admin/src/Service/HTML/System.php
+++ b/administrator/components/com_admin/src/Service/HTML/System.php
@@ -32,6 +32,6 @@ class System
*/
public function server($val)
{
- return !empty($val) ? $val : Text::_('COM_ADMIN_NA');
+ return empty($val) ? Text::_('COM_ADMIN_NA') : $val;
}
}
diff --git a/administrator/components/com_admin/src/View/Help/HtmlView.php b/administrator/components/com_admin/src/View/Help/HtmlView.php
index 9d893b8cd8a70..dc38a29548b7e 100644
--- a/administrator/components/com_admin/src/View/Help/HtmlView.php
+++ b/administrator/components/com_admin/src/View/Help/HtmlView.php
@@ -32,7 +32,7 @@ class HtmlView extends BaseHtmlView
* @var string
* @since 1.6
*/
- protected $helpSearch = null;
+ protected $helpSearch;
/**
* The page to be viewed
@@ -40,7 +40,7 @@ class HtmlView extends BaseHtmlView
* @var string
* @since 1.6
*/
- protected $page = null;
+ protected $page;
/**
* The iso language tag
@@ -48,7 +48,7 @@ class HtmlView extends BaseHtmlView
* @var string
* @since 1.6
*/
- protected $languageTag = null;
+ protected $languageTag;
/**
* Table of contents
diff --git a/administrator/components/com_admin/src/View/Sysinfo/HtmlView.php b/administrator/components/com_admin/src/View/Sysinfo/HtmlView.php
index 4fc9b4249b42b..4ce29bcdcc0ea 100644
--- a/administrator/components/com_admin/src/View/Sysinfo/HtmlView.php
+++ b/administrator/components/com_admin/src/View/Sysinfo/HtmlView.php
@@ -59,7 +59,7 @@ class HtmlView extends BaseHtmlView
* @var string
* @since 1.6
*/
- protected $phpInfo = null;
+ protected $phpInfo;
/**
* Information about writable state of directories
diff --git a/administrator/components/com_admin/tmpl/help/langforum.php b/administrator/components/com_admin/tmpl/help/langforum.php
index c7f8518d8f8fd..9919dea8adfde 100644
--- a/administrator/components/com_admin/tmpl/help/langforum.php
+++ b/administrator/components/com_admin/tmpl/help/langforum.php
@@ -1,5 +1,7 @@
getLanguage()->load('mod_menu', JPATH_ADMINISTRATOR);
$forumId = (int) Text::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE');
-if (empty($forumId)) {
+if ($forumId === 0) {
$forumId = 511;
}
diff --git a/administrator/components/com_admin/tmpl/sysinfo/default_system.php b/administrator/components/com_admin/tmpl/sysinfo/default_system.php
index 06e1bdb41f60a..4e1486f2bd850 100644
--- a/administrator/components/com_admin/tmpl/sysinfo/default_system.php
+++ b/administrator/components/com_admin/tmpl/sysinfo/default_system.php
@@ -133,7 +133,7 @@
- info['useragent'], ENT_COMPAT, 'UTF-8'); ?>
+ info['useragent'], ENT_COMPAT, 'UTF-8'); ?>
|
diff --git a/administrator/components/com_associations/layouts/joomla/searchtools/default.php b/administrator/components/com_associations/layouts/joomla/searchtools/default.php
index 12b04a06c2b28..4275a64bde482 100644
--- a/administrator/components/com_associations/layouts/joomla/searchtools/default.php
+++ b/administrator/components/com_associations/layouts/joomla/searchtools/default.php
@@ -20,7 +20,7 @@
$data = $displayData;
// Receive overridable options
-$data['options'] = !empty($data['options']) ? $data['options'] : [];
+$data['options'] = empty($data['options']) ? [] : $data['options'];
$noResultsText = '';
$hideActiveFilters = false;
@@ -69,8 +69,8 @@
'showSelector' => $showSelector,
'orderFieldSelector' => '#list_fullordering',
'showNoResults' => !empty($noResultsText),
- 'noResultsText' => !empty($noResultsText) ? $noResultsText : '',
- 'formSelector' => !empty($data['options']['formSelector']) ? $data['options']['formSelector'] : '#adminForm',
+ 'noResultsText' => empty($noResultsText) ? '' : $noResultsText,
+ 'formSelector' => empty($data['options']['formSelector']) ? '#adminForm' : $data['options']['formSelector'],
];
// Merge custom options in the options array.
diff --git a/administrator/components/com_associations/src/Controller/AssociationController.php b/administrator/components/com_associations/src/Controller/AssociationController.php
index 54db9cba3e9e1..abadc9a449bc0 100644
--- a/administrator/components/com_associations/src/Controller/AssociationController.php
+++ b/administrator/components/com_associations/src/Controller/AssociationController.php
@@ -39,7 +39,7 @@ class AssociationController extends FormController
*/
public function edit($key = null, $urlVar = null)
{
- list($extensionName, $typeName) = explode('.', $this->input->get('itemtype', '', 'string'), 2);
+ [$extensionName, $typeName] = explode('.', (string) $this->input->get('itemtype', '', 'string'), 2);
$id = $this->input->get('id', 0, 'int');
@@ -67,7 +67,7 @@ public function cancel($key = null)
{
$this->checkToken();
- list($extensionName, $typeName) = explode('.', $this->input->get('itemtype', '', 'string'), 2);
+ [$extensionName, $typeName] = explode('.', (string) $this->input->get('itemtype', '', 'string'), 2);
// Only check in, if component item type allows to check out.
if (AssociationsHelper::typeSupportsCheckout($extensionName, $typeName)) {
@@ -75,12 +75,12 @@ public function cancel($key = null)
$targetId = $this->input->get('target-id', '', 'string');
if ($targetId !== '') {
- $ids = array_unique(explode(',', $targetId));
+ $ids = array_unique(explode(',', (string) $targetId));
}
$ids[] = $this->input->get('id', 0, 'int');
- foreach ($ids as $key => $id) {
+ foreach ($ids as $id) {
AssociationsHelper::getItem($extensionName, $typeName, $id)->checkIn();
}
}
diff --git a/administrator/components/com_associations/src/Controller/AssociationsController.php b/administrator/components/com_associations/src/Controller/AssociationsController.php
index dd24dad3cd972..d91ac6eb0272f 100644
--- a/administrator/components/com_associations/src/Controller/AssociationsController.php
+++ b/administrator/components/com_associations/src/Controller/AssociationsController.php
@@ -12,6 +12,7 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\AdminController;
+use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Router\Route;
use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;
@@ -42,7 +43,7 @@ class AssociationsController extends AdminController
* @param string $prefix The class prefix. Optional.
* @param array $config The array of possible config values. Optional.
*
- * @return \Joomla\CMS\MVC\Model\BaseDatabaseModel|boolean
+ * @return BaseDatabaseModel|boolean
*
* @since 3.7.0
*/
@@ -94,7 +95,7 @@ public function checkin()
$this->setRedirect(Route::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));
// Figure out if the item supports checking and check it in
- list($extensionName, $typeName) = explode('.', $this->input->get('itemtype'));
+ [$extensionName, $typeName] = explode('.', (string) $this->input->get('itemtype'));
$extension = AssociationsHelper::getSupportedExtension($extensionName);
$types = $extension->get('types');
@@ -110,7 +111,7 @@ public function checkin()
$cid = (array) $this->input->get('cid', [], 'int');
- if (empty($cid)) {
+ if ($cid === []) {
// Seems we don't have an id to work with.
return;
}
diff --git a/administrator/components/com_associations/src/Dispatcher/Dispatcher.php b/administrator/components/com_associations/src/Dispatcher/Dispatcher.php
index 4875f196e2110..d62e262eb59f2 100644
--- a/administrator/components/com_associations/src/Dispatcher/Dispatcher.php
+++ b/administrator/components/com_associations/src/Dispatcher/Dispatcher.php
@@ -43,7 +43,7 @@ protected function checkAccess()
$itemType = $this->input->get('itemtype', '', 'string');
if ($itemType !== '') {
- list($extensionName, $typeName) = explode('.', $itemType);
+ [$extensionName, $typeName] = explode('.', (string) $itemType);
if (!AssociationsHelper::hasSupport($extensionName)) {
throw new \Exception(
diff --git a/administrator/components/com_associations/src/Field/ItemlanguageField.php b/administrator/components/com_associations/src/Field/ItemlanguageField.php
index 9c7d24754f4f7..91804a81f91e2 100644
--- a/administrator/components/com_associations/src/Field/ItemlanguageField.php
+++ b/administrator/components/com_associations/src/Field/ItemlanguageField.php
@@ -46,7 +46,7 @@ protected function getOptions()
{
$input = Factory::getApplication()->getInput();
- list($extensionName, $typeName) = explode('.', $input->get('itemtype', '', 'string'), 2);
+ [$extensionName, $typeName] = explode('.', (string) $input->get('itemtype', '', 'string'), 2);
// Get the extension specific helper method
$helper = AssociationsHelper::getExtensionHelper($extensionName);
diff --git a/administrator/components/com_associations/src/Field/Modal/AssociationField.php b/administrator/components/com_associations/src/Field/Modal/AssociationField.php
index e68292c596f38..b74acba3e151c 100644
--- a/administrator/components/com_associations/src/Field/Modal/AssociationField.php
+++ b/administrator/components/com_associations/src/Field/Modal/AssociationField.php
@@ -46,7 +46,7 @@ protected function getInput()
{
// @todo USE Layouts here!!!
// The active item id field.
- $value = (int) $this->value ?: '';
+ $value = (int) $this->value !== 0 ? (int) $this->value : '';
$doc = Factory::getApplication()->getDocument();
$wa = $doc->getWebAssetManager();
@@ -68,7 +68,7 @@ protected function getInput()
$html[] = ' | |