diff --git a/build/rector.php b/build/rector.php index 227f79a05bde8..93155f7acc211 100644 --- a/build/rector.php +++ b/build/rector.php @@ -19,6 +19,7 @@ use Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfPhpVersionRector; use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector; use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector; +use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector; @@ -44,7 +45,7 @@ SetList::EARLY_RETURN, SetList::INSTANCEOF, //SetList::NAMING, - //SetList::PRIVATIZATION, + SetList::PRIVATIZATION, //SetList::STRICT_BOOLEANS, //SetList::TYPE_DECLARATION, ]); @@ -74,7 +75,8 @@ RemoveAlwaysTrueIfConditionRector::class => [__DIR__ . '/../libraries/bootstrap.php'], // Do not add $app and $db as properties CompleteDynamicPropertiesRector::class => [__DIR__ . '/../libraries/src/Plugin/CMSPlugin.php'], - + // The setArgument function in events uses unused functions + PrivatizeFinalClassMethodRector::class => ['*/Event/*'], // Ignore vendor '*/vendor/*' ]); diff --git a/installation/src/Application/CliInstallationApplication.php b/installation/src/Application/CliInstallationApplication.php index 302b157f8cb9b..675f8167f9870 100644 --- a/installation/src/Application/CliInstallationApplication.php +++ b/installation/src/Application/CliInstallationApplication.php @@ -59,7 +59,7 @@ final class CliInstallationApplication extends Application implements CMSApplica * @var MVCFactory * @since 4.3.0 */ - protected $mvcFactory; + private $mvcFactory; /** * Object to imitate the session object @@ -67,7 +67,7 @@ final class CliInstallationApplication extends Application implements CMSApplica * @var Registry * @since 4.3.0 */ - protected $session; + private $session; /** * The client application Id @@ -75,7 +75,7 @@ final class CliInstallationApplication extends Application implements CMSApplica * @var Integer * @since 5.0.2 */ - protected $clientId = 2; + private $clientId = 2; /** * Class constructor. @@ -102,7 +102,7 @@ public function __construct( * * @since 4.3.0 */ - protected ?Language $language = null + private ?Language $language = null ) { // Register the application name. $this->setName('Joomla CLI installation'); diff --git a/installation/src/Application/InstallationApplication.php b/installation/src/Application/InstallationApplication.php index 01d87318c8233..796e1079ad208 100644 --- a/installation/src/Application/InstallationApplication.php +++ b/installation/src/Application/InstallationApplication.php @@ -263,16 +263,12 @@ public function execute() * will extend this method in child classes to provide configuration data from whatever data source is relevant * for your specific application. * - * @param string $file The path and filename of the configuration file. If not provided, configuration.php - * in JPATH_BASE will be used. - * @param string $class The class name to instantiate. * * @return mixed Either an array or object to be loaded into the configuration object. - * * @since 1.7.3 * @throws \RuntimeException */ - protected function fetchConfigurationData($file = '', $class = 'JConfig') + private function fetchConfigurationData() { return []; } diff --git a/libraries/src/Application/ApiApplication.php b/libraries/src/Application/ApiApplication.php index 08dadf3982001..06ec58c71a4c6 100644 --- a/libraries/src/Application/ApiApplication.php +++ b/libraries/src/Application/ApiApplication.php @@ -46,7 +46,7 @@ final class ApiApplication extends CMSApplication * @var array * @since 4.0.0 */ - protected $formatMapper = []; + private $formatMapper = []; /** * The authentication plugin type @@ -332,7 +332,7 @@ protected function route() * * @since 4.0.0 */ - protected function handlePreflight($method, $router) + private function handlePreflight($method, $router) { /** * If not an OPTIONS request or CORS is not enabled, diff --git a/libraries/src/Application/SiteApplication.php b/libraries/src/Application/SiteApplication.php index 2e0a8bacfbcdc..f9f8d12a80a27 100644 --- a/libraries/src/Application/SiteApplication.php +++ b/libraries/src/Application/SiteApplication.php @@ -50,7 +50,7 @@ final class SiteApplication extends CMSApplication * @var boolean * @since 4.0.0 */ - protected $language_filter = false; + private $language_filter = false; /** * Option to detect language by the browser @@ -58,7 +58,7 @@ final class SiteApplication extends CMSApplication * @var boolean * @since 4.0.0 */ - protected $detect_browser = false; + private $detect_browser = false; /** * The registered URL parameters. @@ -107,7 +107,7 @@ public function __construct(?Input $input = null, ?Registry $config = null, ?Web * * @throws \Exception When you are not authorised to view the home page menu item */ - protected function authorise($itemid) + private function authorise($itemid) { $menus = $this->getMenu(); $user = Factory::getUser(); @@ -436,7 +436,7 @@ public function getTemplate($params = false) /** @var OutputController $cache */ $cache = $this->getCacheControllerFactory()->createCacheController('output', ['defaultgroup' => 'com_templates']); - $tag = $this->getLanguageFilter() ? $this->getLanguage()->getTag() : ''; + $tag = $this->language_filter ? $this->getLanguage()->getTag() : ''; $cacheId = 'templates0' . $tag; @@ -448,7 +448,7 @@ public function getTemplate($params = false) foreach ($templates as &$template) { // Create home element - if ($template->home == 1 && !isset($template_home) || $this->getLanguageFilter() && $template->home == $tag) { + if ($template->home == 1 && !isset($template_home) || $this->language_filter && $template->home == $tag) { $template_home = clone $template; } @@ -566,7 +566,7 @@ protected function initialiseApp($options = []) } } - if (empty($options['language']) && $this->getLanguageFilter()) { + if (empty($options['language']) && $this->language_filter) { // Detect cookie language $lang = $this->input->cookie->get(md5($this->get('secret') . 'language'), null, 'string'); @@ -586,7 +586,7 @@ protected function initialiseApp($options = []) } } - if (empty($options['language']) && $this->getDetectBrowser()) { + if (empty($options['language']) && $this->detect_browser) { // Detect browser language $lang = LanguageHelper::detectLanguage(); @@ -786,7 +786,7 @@ protected function route() */ public function setDetectBrowser($state = false) { - $old = $this->getDetectBrowser(); + $old = $this->detect_browser; $this->detect_browser = $state; return $old; @@ -803,7 +803,7 @@ public function setDetectBrowser($state = false) */ public function setLanguageFilter($state = false) { - $old = $this->getLanguageFilter(); + $old = $this->language_filter; $this->language_filter = $state; return $old; diff --git a/libraries/src/Editor/Button/Button.php b/libraries/src/Editor/Button/Button.php index 909655036ce59..45ca56bf6e9e3 100644 --- a/libraries/src/Editor/Button/Button.php +++ b/libraries/src/Editor/Button/Button.php @@ -24,7 +24,7 @@ final class Button implements ButtonInterface * * @since 5.0.0 */ - public function __construct(protected string $name, protected array $props = [], protected array $options = []) + public function __construct(private readonly string $name, private array $props = [], private array $options = []) { } @@ -56,7 +56,7 @@ public function get(string $name, $default = null) \E_USER_DEPRECATED ); - return $this->getOptions(); + return $this->options; } return \array_key_exists($name, $this->props) ? $this->props[$name] : $default; diff --git a/libraries/src/Editor/Button/ButtonsRegistry.php b/libraries/src/Editor/Button/ButtonsRegistry.php index c5396e4b47129..851f7be1f5f6c 100644 --- a/libraries/src/Editor/Button/ButtonsRegistry.php +++ b/libraries/src/Editor/Button/ButtonsRegistry.php @@ -36,7 +36,7 @@ final class ButtonsRegistry implements ButtonsRegistryInterface, DispatcherAware * @var array * @since 5.0.0 */ - protected $registry = []; + private $registry = []; /** * Internal flag of initialisation diff --git a/libraries/src/Installer/Installer.php b/libraries/src/Installer/Installer.php index d418dbb7b4c1f..553568688f3be 100644 --- a/libraries/src/Installer/Installer.php +++ b/libraries/src/Installer/Installer.php @@ -978,7 +978,7 @@ public function parseQueries(\SimpleXMLElement $element) // Get the database connector object $db = & $this->_db; - if (!$element instanceof \SimpleXMLElement || !\count($element->children())) { + if (\count($element->children()) === 0) { // Either the tag does not exist or has no children therefore we return zero files processed. return 0; } @@ -1376,7 +1376,7 @@ protected function updateSchemaTable(int $eid, string $version, bool $update = f public function parseFiles(\SimpleXMLElement $element, $cid = 0, $oldFiles = null, $oldMD5 = null) { // Get the array of file nodes to process; we checked whether this had children above. - if (!$element instanceof \SimpleXMLElement || !\count($element->children())) { + if (\count($element->children()) === 0) { // Either the tag does not exist or has no children (hence no files to process) therefore we return zero files processed. return 0; } @@ -1503,7 +1503,7 @@ public function parseFiles(\SimpleXMLElement $element, $cid = 0, $oldFiles = nul public function parseLanguages(\SimpleXMLElement $element, $cid = 0) { // @todo: work out why the below line triggers 'node no longer exists' errors with files - if (!$element instanceof \SimpleXMLElement || !\count($element->children())) { + if (\count($element->children()) === 0) { // Either the tag does not exist or has no children therefore we return zero files processed. return 0; } @@ -1614,7 +1614,7 @@ public function parseLanguages(\SimpleXMLElement $element, $cid = 0) */ public function parseMedia(\SimpleXMLElement $element, $cid = 0) { - if (!$element instanceof \SimpleXMLElement || !\count($element->children())) { + if (\count($element->children()) === 0) { // Either the tag does not exist or has no children therefore we return zero files processed. return 0; } diff --git a/libraries/src/Log/DelegatingPsrLogger.php b/libraries/src/Log/DelegatingPsrLogger.php index d405352c75667..745f412b87d17 100644 --- a/libraries/src/Log/DelegatingPsrLogger.php +++ b/libraries/src/Log/DelegatingPsrLogger.php @@ -31,7 +31,7 @@ final class DelegatingPsrLogger extends AbstractLogger * @var array * @since 3.8.0 */ - protected $priorityMap = [ + private $priorityMap = [ LogLevel::EMERGENCY => Log::EMERGENCY, LogLevel::ALERT => Log::ALERT, LogLevel::CRITICAL => Log::CRITICAL, @@ -55,7 +55,7 @@ public function __construct( * * @since 3.8.0 */ - protected Log $logger + private readonly Log $logger ) { } diff --git a/plugins/actionlog/joomla/src/Extension/Joomla.php b/plugins/actionlog/joomla/src/Extension/Joomla.php index 1c2df29ca0f6f..065c34104ea34 100644 --- a/plugins/actionlog/joomla/src/Extension/Joomla.php +++ b/plugins/actionlog/joomla/src/Extension/Joomla.php @@ -65,7 +65,7 @@ final class Joomla extends ActionLogPlugin implements SubscriberInterface * @var array * @since 3.9.0 */ - protected $loggableExtensions = []; + private $loggableExtensions = []; /** * Context aliases @@ -73,7 +73,7 @@ final class Joomla extends ActionLogPlugin implements SubscriberInterface * @var array * @since 3.9.0 */ - protected $contextAliases = ['com_content.form' => 'com_content.article']; + private $contextAliases = ['com_content.form' => 'com_content.article']; /** * Flag for loggable Api. @@ -81,7 +81,7 @@ final class Joomla extends ActionLogPlugin implements SubscriberInterface * @var boolean * @since 4.0.0 */ - protected $loggableApi = false; + private $loggableApi = false; /** * Array of loggable verbs. @@ -89,7 +89,7 @@ final class Joomla extends ActionLogPlugin implements SubscriberInterface * @var array * @since 4.0.0 */ - protected $loggableVerbs = []; + private $loggableVerbs = []; /** * Constructor. @@ -961,7 +961,7 @@ public function onUserLogout(LogoutEvent $event): void * * @since 3.9.0 */ - protected function checkLoggable($extension) + private function checkLoggable($extension) { return \in_array($extension, $this->loggableExtensions); } diff --git a/plugins/content/confirmconsent/src/Extension/ConfirmConsent.php b/plugins/content/confirmconsent/src/Extension/ConfirmConsent.php index 99e9df14d0a93..cac2784cdc431 100644 --- a/plugins/content/confirmconsent/src/Extension/ConfirmConsent.php +++ b/plugins/content/confirmconsent/src/Extension/ConfirmConsent.php @@ -40,7 +40,7 @@ final class ConfirmConsent extends CMSPlugin * * @since 3.9.0 */ - protected $supportedContext = [ + private $supportedContext = [ 'com_contact.contact', 'com_privacy.request', ]; diff --git a/plugins/content/finder/src/Extension/Finder.php b/plugins/content/finder/src/Extension/Finder.php index 83f44d9dbe2b3..534ec9a9f0a1a 100644 --- a/plugins/content/finder/src/Extension/Finder.php +++ b/plugins/content/finder/src/Extension/Finder.php @@ -32,7 +32,7 @@ final class Finder extends CMSPlugin * * @since 5.0.0 */ - protected $pluginsImported = false; + private $pluginsImported = false; /** * Smart Search after save content method. @@ -163,7 +163,7 @@ public function onCategoryChangeState($extension, $pks, $value) * * @since 5.0.0 */ - protected function importFinderPlugins() + private function importFinderPlugins() { if ($this->pluginsImported) { return; diff --git a/plugins/content/loadmodule/src/Extension/LoadModule.php b/plugins/content/loadmodule/src/Extension/LoadModule.php index 75ceefac53e29..9294dcc2023d2 100644 --- a/plugins/content/loadmodule/src/Extension/LoadModule.php +++ b/plugins/content/loadmodule/src/Extension/LoadModule.php @@ -25,9 +25,9 @@ */ final class LoadModule extends CMSPlugin { - protected static $modules = []; + private static $modules = []; - protected static $mods = []; + private static $mods = []; /** * Plugin that loads module positions within content diff --git a/plugins/content/pagebreak/src/Extension/PageBreak.php b/plugins/content/pagebreak/src/Extension/PageBreak.php index c11a4fa1f6690..3544350d34156 100644 --- a/plugins/content/pagebreak/src/Extension/PageBreak.php +++ b/plugins/content/pagebreak/src/Extension/PageBreak.php @@ -46,7 +46,7 @@ final class PageBreak extends CMSPlugin * @var array * @since 4.0.0 */ - protected $list = []; + private $list = []; /** * Plugin that adds a pagebreak into the text and truncates text at that point diff --git a/plugins/content/vote/src/Extension/Vote.php b/plugins/content/vote/src/Extension/Vote.php index 1485873809ccc..24d34f62a7ad7 100644 --- a/plugins/content/vote/src/Extension/Vote.php +++ b/plugins/content/vote/src/Extension/Vote.php @@ -183,7 +183,7 @@ public function onSchemaBeforeCompileHead($schema, $context): void * * @since 5.2.0 */ - protected function prepareAggregateRating($context) + private function prepareAggregateRating($context) { [$extension, $view, $id] = explode('.', $context); @@ -211,7 +211,7 @@ protected function prepareAggregateRating($context) * * @since 5.2.0 */ - protected function prepareProductAggregateRating($context) + private function prepareProductAggregateRating($context) { [$extension, $view, $id] = explode('.', $context); diff --git a/plugins/editors/codemirror/src/Provider/CodeMirrorProvider.php b/plugins/editors/codemirror/src/Provider/CodeMirrorProvider.php index 4390e37162c6e..3ed3901915c37 100644 --- a/plugins/editors/codemirror/src/Provider/CodeMirrorProvider.php +++ b/plugins/editors/codemirror/src/Provider/CodeMirrorProvider.php @@ -9,7 +9,6 @@ namespace Joomla\Plugin\Editors\CodeMirror\Provider; -use Joomla\CMS\Application\CMSApplicationInterface; use Joomla\CMS\Editor\AbstractEditorProvider; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Uri\Uri; @@ -27,9 +26,7 @@ final class CodeMirrorProvider extends AbstractEditorProvider * Class constructor * * @param Registry $params - * @param CMSApplicationInterface $application * @param DispatcherInterface $dispatcher - * * @since 5.0.0 */ public function __construct(/** @@ -37,13 +34,7 @@ public function __construct(/** * * @since 5.0.0 */ - protected Registry $params, /** - * The application object - * - * - * @since 5.0.0 - */ - protected CMSApplicationInterface $application, DispatcherInterface $dispatcher) + private readonly Registry $params, DispatcherInterface $dispatcher) { $this->setDispatcher($dispatcher); } diff --git a/plugins/editors/none/src/Provider/EditorNoneProvider.php b/plugins/editors/none/src/Provider/EditorNoneProvider.php index e3b2bcf9e6f4b..4889f2f02ba68 100644 --- a/plugins/editors/none/src/Provider/EditorNoneProvider.php +++ b/plugins/editors/none/src/Provider/EditorNoneProvider.php @@ -13,7 +13,6 @@ use Joomla\CMS\Application\CMSApplicationInterface; use Joomla\CMS\Editor\AbstractEditorProvider; use Joomla\Event\DispatcherInterface; -use Joomla\Registry\Registry; /** * Editor provider class @@ -25,24 +24,17 @@ final class EditorNoneProvider extends AbstractEditorProvider /** * Class constructor * - * @param Registry $params * @param CMSApplicationInterface $application * @param DispatcherInterface $dispatcher - * * @since 5.2.0 */ public function __construct(/** - * A Registry object holding the parameters for the plugin - * - * @since 5.2.0 - */ - protected Registry $params, /** * The application object * * * @since 5.2.0 */ - protected CMSApplicationInterface $application, DispatcherInterface $dispatcher) + private readonly CMSApplicationInterface $application, DispatcherInterface $dispatcher) { $this->setDispatcher($dispatcher); } diff --git a/plugins/extension/finder/src/Extension/Finder.php b/plugins/extension/finder/src/Extension/Finder.php index b77a13868fb29..d34c3df6ea34c 100644 --- a/plugins/extension/finder/src/Extension/Finder.php +++ b/plugins/extension/finder/src/Extension/Finder.php @@ -130,7 +130,7 @@ public function onExtensionAfterUninstall(AfterUninstallEvent $event): void * * @since 4.0.0 */ - protected function addCommonWords($extension) + private function addCommonWords($extension) { if ($extension->client_id == 0) { $path = JPATH_SITE . '/language/' . $extension->element . '/com_finder.commonwords.txt'; @@ -192,7 +192,7 @@ function ($word) { * * @since 4.0.0 */ - protected function removeCommonWords($extension) + private function removeCommonWords($extension) { $db = $this->getDatabase(); $lang = Helper::getPrimaryLanguage($extension->element); diff --git a/plugins/fields/subform/src/Extension/Subform.php b/plugins/fields/subform/src/Extension/Subform.php index 669f451ac171e..90b2ee240d970 100644 --- a/plugins/fields/subform/src/Extension/Subform.php +++ b/plugins/fields/subform/src/Extension/Subform.php @@ -36,7 +36,7 @@ final class Subform extends FieldsPlugin implements SubscriberInterface * * @since 4.0.0 */ - protected $renderCache = []; + private $renderCache = []; /** * Array to do a fast in-memory caching of all custom field items. @@ -45,7 +45,7 @@ final class Subform extends FieldsPlugin implements SubscriberInterface * * @since 4.0.0 */ - protected static $customFieldsCache; + private static $customFieldsCache; /** * Returns an array of events this subscriber will listen to. @@ -340,7 +340,7 @@ public function onCustomFieldsPrepareDom($field, \DOMElement $parent, Form $form * * @since 4.0.0 */ - protected function getOptionsFromField(\stdClass $field) + private function getOptionsFromField(\stdClass $field) { $result = []; @@ -363,7 +363,7 @@ protected function getOptionsFromField(\stdClass $field) * * @since 4.0.0 */ - protected function getParamsFromField(\stdClass $field) + private function getParamsFromField(\stdClass $field) { $params = (clone $this->params); @@ -384,7 +384,7 @@ protected function getParamsFromField(\stdClass $field) * * @since 4.0.0 */ - protected function getSubfieldsFromField(\stdClass $field) + private function getSubfieldsFromField(\stdClass $field) { if (static::$customFieldsCache === null) { // Prepare our cache diff --git a/plugins/sampledata/multilang/src/Extension/MultiLanguage.php b/plugins/sampledata/multilang/src/Extension/MultiLanguage.php index bf35c55efdaac..17b3892811767 100644 --- a/plugins/sampledata/multilang/src/Extension/MultiLanguage.php +++ b/plugins/sampledata/multilang/src/Extension/MultiLanguage.php @@ -53,14 +53,14 @@ final class MultiLanguage extends CMSPlugin * * @since 4.0.0 */ - protected $path; + private $path; /** * @var integer Id, author of all generated content. * * @since 4.0.0 */ - protected $adminId; + private $adminId; /** * Get an overview of the proposed sampledata. @@ -1060,7 +1060,7 @@ public function getInstalledlangsFrontend() * * @since 4.0.0 */ - protected function getInstalledlangs($clientName = 'administrator') + private function getInstalledlangs($clientName = 'administrator') { // Get information. $path = $this->getPath(); @@ -1112,7 +1112,7 @@ protected function getInstalledlangs($clientName = 'administrator') * * @since 4.0.0 */ - protected function getLanguageList($clientId = 1) + private function getLanguageList($clientId = 1) { // Create a new db object. $db = $this->getDatabase(); @@ -1146,7 +1146,7 @@ protected function getLanguageList($clientId = 1) * * @since 4.0.0 */ - protected function compareLanguages($lang1, $lang2) + private function compareLanguages($lang1, $lang2) { return strcmp($lang1->name, $lang2->name); } @@ -1158,7 +1158,7 @@ protected function compareLanguages($lang1, $lang2) * * @since 4.0.0 */ - protected function getPath() + private function getPath() { if ($this->path === null) { $client = $this->getClient(); @@ -1177,7 +1177,7 @@ protected function getPath() * * @since 4.0.0 */ - protected function getClient($client = 'administrator') + private function getClient($client = 'administrator') { return ApplicationHelper::getClientInfo($client, true); } diff --git a/plugins/sampledata/testing/src/Extension/Testing.php b/plugins/sampledata/testing/src/Extension/Testing.php index a828ffaab002b..3acf91889d411 100644 --- a/plugins/sampledata/testing/src/Extension/Testing.php +++ b/plugins/sampledata/testing/src/Extension/Testing.php @@ -64,7 +64,7 @@ final class Testing extends CMSPlugin */ private $menuItemModel; - protected $menuModuleMapping = []; + private $menuModuleMapping = []; /** * Get an overview of the proposed sampledata. @@ -2294,7 +2294,7 @@ public function onAjaxSampledataApplyStep7() return $response; } - protected function addFrontendViewsMenu($menuTypes) + private function addFrontendViewsMenu($menuTypes) { // Get previously entered Data from UserStates $contactIds = $this->getApplication()->getUserState('sampledata.testing.contacts'); diff --git a/plugins/system/debug/src/DataCollector/LanguageErrorsCollector.php b/plugins/system/debug/src/DataCollector/LanguageErrorsCollector.php index d774f1e1c6f2c..3f3a1977d1b3a 100644 --- a/plugins/system/debug/src/DataCollector/LanguageErrorsCollector.php +++ b/plugins/system/debug/src/DataCollector/LanguageErrorsCollector.php @@ -57,7 +57,7 @@ public function collect(): array 'jroot' => JPATH_ROOT, 'xdebugLink' => $this->getXdebugLinkTemplate(), ], - 'count' => $this->getCount(), + 'count' => $this->count, ]; } @@ -138,16 +138,4 @@ private function getData(): array return $errors; } - - /** - * Get a count value. - * - * @return int - * - * @since 4.0.0 - */ - private function getCount(): int - { - return $this->count; - } } diff --git a/plugins/system/debug/src/Extension/Debug.php b/plugins/system/debug/src/Extension/Debug.php index d8c8a4e20f384..fd64b47b36e50 100644 --- a/plugins/system/debug/src/Extension/Debug.php +++ b/plugins/system/debug/src/Extension/Debug.php @@ -117,7 +117,7 @@ final class Debug extends CMSPlugin implements SubscriberInterface * @var bool * @since 4.0.0 */ - protected $isAjax = false; + private $isAjax = false; /** * Whether displaying a logs is enabled @@ -125,7 +125,7 @@ final class Debug extends CMSPlugin implements SubscriberInterface * @var bool * @since 4.0.0 */ - protected $showLogs = false; + private $showLogs = false; /** * The time spent in onAfterDisconnect() @@ -133,7 +133,7 @@ final class Debug extends CMSPlugin implements SubscriberInterface * @var float * @since 4.4.0 */ - protected $timeInOnAfterDisconnect = 0; + private $timeInOnAfterDisconnect = 0; /** * @return array diff --git a/plugins/system/guidedtours/src/Extension/GuidedTours.php b/plugins/system/guidedtours/src/Extension/GuidedTours.php index f9fd1978296ad..cbbb9cb9b168b 100644 --- a/plugins/system/guidedtours/src/Extension/GuidedTours.php +++ b/plugins/system/guidedtours/src/Extension/GuidedTours.php @@ -44,7 +44,7 @@ final class GuidedTours extends CMSPlugin implements SubscriberInterface * @var string[] * @since 4.3.0 */ - protected $stepType = [ + private $stepType = [ GuidedtoursComponent::STEP_NEXT => 'next', GuidedtoursComponent::STEP_REDIRECT => 'redirect', GuidedtoursComponent::STEP_INTERACTIVE => 'interactive', @@ -56,7 +56,7 @@ final class GuidedTours extends CMSPlugin implements SubscriberInterface * @var string[] * @since 4.3.0 */ - protected $stepInteractiveType = [ + private $stepInteractiveType = [ GuidedtoursComponent::STEP_INTERACTIVETYPE_FORM_SUBMIT => 'submit', GuidedtoursComponent::STEP_INTERACTIVETYPE_TEXT => 'text', GuidedtoursComponent::STEP_INTERACTIVETYPE_OTHER => 'other', @@ -72,7 +72,7 @@ final class GuidedTours extends CMSPlugin implements SubscriberInterface * * @since 4.3.0 */ - protected static $enabled = false; + private static $enabled = false; /** * Constructor diff --git a/plugins/system/languagefilter/src/Extension/LanguageFilter.php b/plugins/system/languagefilter/src/Extension/LanguageFilter.php index d71b2865b47bb..703f60be040df 100644 --- a/plugins/system/languagefilter/src/Extension/LanguageFilter.php +++ b/plugins/system/languagefilter/src/Extension/LanguageFilter.php @@ -54,7 +54,7 @@ final class LanguageFilter extends CMSPlugin implements SubscriberInterface * @var boolean * @since 2.5 */ - protected $mode_sef; + private $mode_sef; /** * Available languages by sef. @@ -62,7 +62,7 @@ final class LanguageFilter extends CMSPlugin implements SubscriberInterface * @var array * @since 1.6 */ - protected $sefs; + private $sefs; /** * Available languages by language codes. @@ -70,7 +70,7 @@ final class LanguageFilter extends CMSPlugin implements SubscriberInterface * @var array * @since 2.5 */ - protected $lang_codes; + private $lang_codes; /** * The current language code. @@ -78,7 +78,7 @@ final class LanguageFilter extends CMSPlugin implements SubscriberInterface * @var string * @since 3.4.2 */ - protected $current_lang; + private $current_lang; /** * The default language code. @@ -86,7 +86,7 @@ final class LanguageFilter extends CMSPlugin implements SubscriberInterface * @var string * @since 2.5 */ - protected $default_lang; + private $default_lang; /** * The logged user language code. diff --git a/plugins/system/schemaorg/src/Extension/Schemaorg.php b/plugins/system/schemaorg/src/Extension/Schemaorg.php index df8a8e2575f5e..d01895d774ac6 100644 --- a/plugins/system/schemaorg/src/Extension/Schemaorg.php +++ b/plugins/system/schemaorg/src/Extension/Schemaorg.php @@ -515,7 +515,7 @@ private function cleanupSchema($schema) * * @since 5.0.0 */ - protected function isSupported($context) + private function isSupported($context) { // We need at least the extension + view for loading the table fields if (!str_contains($context, '.')) { diff --git a/plugins/system/sef/src/Extension/Sef.php b/plugins/system/sef/src/Extension/Sef.php index 97d0181132610..bf916ac500b7e 100644 --- a/plugins/system/sef/src/Extension/Sef.php +++ b/plugins/system/sef/src/Extension/Sef.php @@ -357,7 +357,7 @@ public function enforceSuffix() * * @since 5.1.0 */ - protected function removeIndexphp() + private function removeIndexphp() { $origUri = Uri::getInstance(); @@ -419,7 +419,7 @@ public function addTrailingSlash(&$router, &$uri) * * @since 5.1.0 */ - protected function enforceTrailingSlash() + private function enforceTrailingSlash() { $originalUri = Uri::getInstance(); @@ -445,7 +445,7 @@ protected function enforceTrailingSlash() * * @since 5.2.0 */ - protected function enforceSEF() + private function enforceSEF() { $app = $this->getApplication(); $origUri = clone Uri::getInstance(); diff --git a/plugins/system/stats/src/Extension/Stats.php b/plugins/system/stats/src/Extension/Stats.php index a7882b33c95d4..ce8486ac98283 100644 --- a/plugins/system/stats/src/Extension/Stats.php +++ b/plugins/system/stats/src/Extension/Stats.php @@ -61,7 +61,7 @@ final class Stats extends CMSPlugin * * @since 3.5 */ - protected $serverUrl = 'https://developer.joomla.org/stats/submit'; + private $serverUrl = 'https://developer.joomla.org/stats/submit'; /** * Unique identifier for this site @@ -70,7 +70,7 @@ final class Stats extends CMSPlugin * * @since 3.5 */ - protected $uniqueId; + private $uniqueId; /** * Listener for the `onAfterInitialise` event diff --git a/plugins/task/checkfiles/src/Extension/Checkfiles.php b/plugins/task/checkfiles/src/Extension/Checkfiles.php index 3fed13a6f8423..a878e662608fe 100644 --- a/plugins/task/checkfiles/src/Extension/Checkfiles.php +++ b/plugins/task/checkfiles/src/Extension/Checkfiles.php @@ -97,7 +97,7 @@ public function __construct(DispatcherInterface $dispatcher, array $config, /** * @throws \RuntimeException * @throws \LogicException */ - protected function checkImages(ExecuteTaskEvent $event): int + private function checkImages(ExecuteTaskEvent $event): int { $params = $event->getArgument('params'); $path = Path::check($this->rootDirectory . $params->path); diff --git a/plugins/task/requests/src/Extension/Requests.php b/plugins/task/requests/src/Extension/Requests.php index 7d0e8fc055c78..3bcf26637bb79 100644 --- a/plugins/task/requests/src/Extension/Requests.php +++ b/plugins/task/requests/src/Extension/Requests.php @@ -103,7 +103,7 @@ public function __construct(DispatcherInterface $dispatcher, array $config, /** * @since 4.1.0 * @throws \Exception */ - protected function makeGetRequest(ExecuteTaskEvent $event): int + private function makeGetRequest(ExecuteTaskEvent $event): int { $id = $event->getTaskId(); $params = $event->getArgument('params'); diff --git a/plugins/workflow/featuring/src/Extension/Featuring.php b/plugins/workflow/featuring/src/Extension/Featuring.php index 2735609520148..96f35936f69fd 100644 --- a/plugins/workflow/featuring/src/Extension/Featuring.php +++ b/plugins/workflow/featuring/src/Extension/Featuring.php @@ -59,7 +59,7 @@ final class Featuring extends CMSPlugin implements SubscriberInterface * @var string * @since 4.0.0 */ - protected $supportFunctionality = 'core.featured'; + private $supportFunctionality = 'core.featured'; /** * Returns an array of events this subscriber will listen to. @@ -118,7 +118,7 @@ public function onContentPrepareForm(PrepareFormEvent $event) * * @since 4.0.0 */ - protected function enhanceItemForm(Form $form, $data) + private function enhanceItemForm(Form $form, $data) { $context = $form->getName(); diff --git a/plugins/workflow/publishing/src/Extension/Publishing.php b/plugins/workflow/publishing/src/Extension/Publishing.php index 36bea4972b5b5..8504b6d4ee3a9 100644 --- a/plugins/workflow/publishing/src/Extension/Publishing.php +++ b/plugins/workflow/publishing/src/Extension/Publishing.php @@ -58,7 +58,7 @@ final class Publishing extends CMSPlugin implements SubscriberInterface * @var string * @since 4.0.0 */ - protected $supportFunctionality = 'core.state'; + private $supportFunctionality = 'core.state'; /** * Returns an array of events this subscriber will listen to. @@ -115,7 +115,7 @@ public function onContentPrepareForm(PrepareFormEvent $event) * * @since 4.0.0 */ - protected function enhanceTransitionForm(Form $form, $data) + private function enhanceTransitionForm(Form $form, $data) { $workflow = $this->enhanceWorkflowTransitionForm($form, $data); @@ -139,7 +139,7 @@ protected function enhanceTransitionForm(Form $form, $data) * * @since 4.0.0 */ - protected function enhanceItemForm(Form $form, $data) + private function enhanceItemForm(Form $form, $data) { $context = $form->getName();