Skip to content

Commit

Permalink
Code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Dec 13, 2024
1 parent 03adc3d commit 91d73c5
Show file tree
Hide file tree
Showing 662 changed files with 1,782 additions and 1,793 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

namespace Joomla\Component\Actionlogs\Administrator\Plugin;

use Joomla\CMS\Application\CMSApplicationInterface;
use Joomla\CMS\Application\CMSApplication;
use Joomla\Database\DatabaseDriver;
use Joomla\Component\Actionlogs\Administrator\Model\ActionlogModel;
use Joomla\CMS\Application\CMSApplicationInterface;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\Component\Actionlogs\Administrator\Model\ActionlogModel;
use Joomla\Database\DatabaseDriver;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down
8 changes: 4 additions & 4 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
*
* @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
*/
use Joomla\Component\Scheduler\Administrator\Extension\SchedulerComponent;
use Joomla\Component\Scheduler\Administrator\Model\TaskModel;
use Joomla\CMS\Table\Asset;
use Joomla\Component\Cache\Administrator\Model\CacheModel;
use Joomla\CMS\Application\ApplicationHelper;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Extension\ExtensionHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Installer\Installer;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Table\Asset;
use Joomla\CMS\Table\Table;
use Joomla\CMS\Uri\Uri;
use Joomla\Component\Cache\Administrator\Model\CacheModel;
use Joomla\Component\Scheduler\Administrator\Extension\SchedulerComponent;
use Joomla\Component\Scheduler\Administrator\Model\TaskModel;
use Joomla\Database\ParameterType;
use Joomla\Filesystem\File;
use Joomla\Filesystem\Folder;
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_admin/src/Model/HelpModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function &getToc()
foreach ($files as $file) {
$buffer = file_get_contents(JPATH_BASE . '/help/' . $lang_tag . '/' . $file);

if (in_array(preg_match('#<title>(.*?)</title>#', $buffer, $m), [0, false], true)) {
if (\in_array(preg_match('#<title>(.*?)</title>#', $buffer, $m), [0, false], true)) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

namespace Joomla\Component\Associations\Administrator\Controller;

use Joomla\CMS\MVC\Model\BaseDatabaseModel;
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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
namespace Joomla\Component\Associations\Administrator\Helper;

use Joomla\CMS\Association\AssociationExtensionHelper;
use Joomla\CMS\Table\Table;
use Joomla\CMS\Association\AssociationExtensionInterface;
use Joomla\CMS\Association\AssociationServiceInterface;
use Joomla\CMS\Factory;
Expand All @@ -20,6 +19,7 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Table\Table;
use Joomla\Database\ParameterType;
use Joomla\Registry\Registry;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

namespace Joomla\Component\Associations\Administrator\View\Associations;

use Joomla\CMS\Pagination\Pagination;
use Joomla\Registry\Registry;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Associations;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;
use Joomla\Component\Associations\Administrator\Model\AssociationsModel;
use Joomla\Registry\Registry;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

namespace Joomla\Component\Banners\Administrator\Controller;

use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\Component\Banners\Administrator\Model\BannerModel;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Response\JsonResponse;
use Joomla\Component\Banners\Administrator\Model\BannerModel;
use Joomla\Input\Input;
use Joomla\Utilities\ArrayHelper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

namespace Joomla\Component\Banners\Administrator\Controller;

use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

namespace Joomla\Component\Banners\Administrator\Controller;

use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\Component\Banners\Administrator\Model\TracksModel;
use Joomla\CMS\Application\ApplicationHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\Component\Banners\Administrator\Model\TracksModel;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

namespace Joomla\Component\Banners\Administrator\Helper;

use Joomla\Component\Banners\Administrator\Table\ClientTable;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Table\Table;
use Joomla\Component\Banners\Administrator\Table\ClientTable;
use Joomla\Database\ParameterType;

// phpcs:disable PSR1.Files.SideEffects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@

namespace Joomla\Component\Banners\Administrator\Model;

use Joomla\Component\Banners\Administrator\Table\BannerTable;
use Joomla\Component\Categories\Administrator\Model\CategoryModel;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\CMS\Table\Table;
use Joomla\CMS\Table\TableInterface;
use Joomla\CMS\Versioning\VersionableModelTrait;
use Joomla\Component\Banners\Administrator\Table\BannerTable;
use Joomla\Component\Categories\Administrator\Helper\CategoriesHelper;
use Joomla\Component\Categories\Administrator\Model\CategoryModel;
use Joomla\Database\ParameterType;

// phpcs:disable PSR1.Files.SideEffects
Expand Down Expand Up @@ -447,7 +447,7 @@ public function save($data)
$origTable->load($input->getInt('id'));

if ($data['name'] == $origTable->name) {
[$name, $alias] = $this->generateNewTitle($data['catid'], $data['alias'], $data['name']);
[$name, $alias] = $this->generateNewTitle($data['catid'], $data['alias'], $data['name']);
$data['name'] = $name;
$data['alias'] = $alias;
} elseif ($data['alias'] == $origTable->alias) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

namespace Joomla\Component\Banners\Administrator\Model;

use Joomla\CMS\Form\Form;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\CMS\Table\Table;
use Joomla\CMS\Versioning\VersionableModelTrait;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

namespace Joomla\Component\Banners\Administrator\Model;

use Joomla\CMS\Form\Form;
use Joomla\CMS\Application\ApplicationHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\MVC\Model\FormModel;

// phpcs:disable PSR1.Files.SideEffects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public function getBaseName()
$categoryId = $this->getState('filter.category_id');

if (is_numeric($categoryId)) {
$basename = $categoryId > 0 ? str_replace('__CATID__', $categoryId, $basename) : str_replace('__CATID__', '', $basename);
$basename = $categoryId > 0 ? str_replace('__CATID__', $categoryId, $basename) : str_replace('__CATID__', '', $basename);
$categoryName = $this->getCategoryName();
$basename = str_replace('__CATNAME__', $categoryName, $basename);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Banners\Administrator\View\Client;

use Joomla\Registry\Registry;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
Expand All @@ -21,6 +20,7 @@
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Banners\Administrator\Model\ClientModel;
use Joomla\Registry\Registry;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Banners\Administrator\View\Clients;

use Joomla\Registry\Registry;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\Language\Text;
Expand All @@ -19,6 +18,7 @@
use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Banners\Administrator\Model\ClientsModel;
use Joomla\Registry\Registry;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Banners\Administrator\View\Tracks;

use Joomla\Registry\Registry;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\Language\Text;
Expand All @@ -20,6 +19,7 @@
use Joomla\CMS\Router\Route;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Banners\Administrator\Model\TracksModel;
use Joomla\Registry\Registry;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

namespace Joomla\Component\Cache\Administrator\Controller;

use Joomla\Component\Cache\Administrator\Model\CacheModel;
use Joomla\CMS\Event\Cache\AfterPurgeEvent;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Response\JsonResponse;
use Joomla\Component\Cache\Administrator\Model\CacheModel;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

namespace Joomla\Component\Cache\Administrator\View\Cache;

use Joomla\Registry\Registry;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Cache\Administrator\Model\CacheModel;
use Joomla\Registry\Registry;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

namespace Joomla\Component\Categories\Administrator\Controller;

use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\Component\Categories\Administrator\Model\CategoryModel;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Response\JsonResponse;
use Joomla\CMS\Router\Route;
use Joomla\Component\Categories\Administrator\Model\CategoryModel;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

namespace Joomla\Component\Categories\Administrator\Controller;

use Joomla\Component\Categories\Administrator\Model\CategoryModel;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\MVC\Controller\FormController;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Versioning\VersionableControllerTrait;
use Joomla\Component\Categories\Administrator\Model\CategoryModel;
use Joomla\Input\Input;
use Joomla\Registry\Registry;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ public function setup(\SimpleXMLElement $element, $value, $group = null)
public function __get($name)
{
return match ($name) {
'allowAdd' => (bool) $this->$name,
'allowAdd' => (bool) $this->$name,
'customPrefix' => $this->$name,
default => parent::__get($name),
default => parent::__get($name),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Categories\Administrator\Model;

use Joomla\CMS\Table\Table;
use Joomla\CMS\Access\Rules;
use Joomla\CMS\Association\AssociationServiceInterface;
use Joomla\CMS\Categories\CategoryServiceInterface;
Expand All @@ -26,6 +25,7 @@
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Table\Category;
use Joomla\CMS\Table\Table;
use Joomla\CMS\UCM\UCMType;
use Joomla\CMS\Versioning\VersionableModelTrait;
use Joomla\Component\Categories\Administrator\Helper\CategoriesHelper;
Expand Down Expand Up @@ -406,16 +406,16 @@ protected function preprocessForm(Form $form, $data, $group = 'content')
$name = 'category' . ($section ? ('.' . $section) : '');

// Looking first in the component forms folder
$path = Path::clean(JPATH_ADMINISTRATOR . sprintf('/components/%s/forms/%s.xml', $component, $name));
$path = Path::clean(JPATH_ADMINISTRATOR . \sprintf('/components/%s/forms/%s.xml', $component, $name));

// Looking in the component models/forms folder (J! 3)
if (!file_exists($path)) {
$path = Path::clean(JPATH_ADMINISTRATOR . sprintf('/components/%s/models/forms/%s.xml', $component, $name));
$path = Path::clean(JPATH_ADMINISTRATOR . \sprintf('/components/%s/models/forms/%s.xml', $component, $name));
}

// Old way: looking in the component folder
if (!file_exists($path)) {
$path = Path::clean(JPATH_ADMINISTRATOR . sprintf('/components/%s/%s.xml', $component, $name));
$path = Path::clean(JPATH_ADMINISTRATOR . \sprintf('/components/%s/%s.xml', $component, $name));
}

if (file_exists($path)) {
Expand All @@ -434,7 +434,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content')
} else {
// Try to find the component helper.
$eName = str_replace('com_', '', $component);
$path = Path::clean(JPATH_ADMINISTRATOR . sprintf('/components/%s/helpers/category.php', $component));
$path = Path::clean(JPATH_ADMINISTRATOR . \sprintf('/components/%s/helpers/category.php', $component));

if (file_exists($path)) {
$cName = ucfirst($eName) . ucfirst((string) $section) . 'HelperCategory';
Expand Down
Loading

0 comments on commit 91d73c5

Please sign in to comment.