From 4946058aaa64b6b29794a43b3eb2c8c8d8296f05 Mon Sep 17 00:00:00 2001 From: Christian Heel <66922325+heelc29@users.noreply.github.com> Date: Sat, 20 Apr 2024 18:27:39 +0200 Subject: [PATCH 1/9] add rule --- .php-cs-fixer.dist.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 88d148ff58e5a..d18c51ed9065c 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -67,27 +67,29 @@ ->setRules( [ // Basic ruleset is PSR 12 - '@PSR12' => true, + '@PSR12' => true, // Short array syntax - 'array_syntax' => ['syntax' => 'short'], + 'array_syntax' => ['syntax' => 'short'], // List of values separated by a comma is contained on a single line should not have a trailing comma like [$foo, $bar,] = ... - 'no_trailing_comma_in_singleline' => true, + 'no_trailing_comma_in_singleline' => true, // Arrays on multiline should have a trailing comma - 'trailing_comma_in_multiline' => ['elements' => ['arrays']], + 'trailing_comma_in_multiline' => ['elements' => ['arrays']], // Align elements in multiline array and variable declarations on new lines below each other - 'binary_operator_spaces' => ['operators' => ['=>' => 'align_single_space_minimal', '=' => 'align']], + 'binary_operator_spaces' => ['operators' => ['=>' => 'align_single_space_minimal', '=' => 'align']], // The "No break" comment in switch statements - 'no_break_comment' => ['comment_text' => 'No break'], + 'no_break_comment' => ['comment_text' => 'No break'], // Remove unused imports - 'no_unused_imports' => true, + 'no_unused_imports' => true, // Classes from the global namespace should not be imported - 'global_namespace_import' => ['import_classes' => false, 'import_constants' => false, 'import_functions' => false], + 'global_namespace_import' => ['import_classes' => false, 'import_constants' => false, 'import_functions' => false], // Alpha order imports - 'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'], + 'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'], // There should not be useless else cases - 'no_useless_else' => true, + 'no_useless_else' => true, // Native function invocation - 'native_function_invocation' => ['include' => ['@compiler_optimized']], + 'native_function_invocation' => ['include' => ['@compiler_optimized']], + // Adds null to type declarations when parameter have a default null value + 'nullable_type_declaration_for_default_null_value' => true, ] ) ->setFinder($finder); From 4e1521df79a662a2587623b7c27252828ab8e770 Mon Sep 17 00:00:00 2001 From: Christian Heel <66922325+heelc29@users.noreply.github.com> Date: Sat, 20 Apr 2024 18:51:48 +0200 Subject: [PATCH 2/9] administrator --- .../src/Controller/ActionlogsController.php | 10 ++++---- .../src/Model/AssociationsModel.php | 6 ++--- .../src/Controller/BannersController.php | 2 +- .../src/Extension/BannersComponent.php | 2 +- .../com_banners/src/Table/BannerTable.php | 2 +- .../com_banners/src/Table/ClientTable.php | 2 +- .../src/Controller/CategoryController.php | 10 ++++---- .../src/Controller/DisplayController.php | 10 ++++---- .../src/Model/CategoriesModel.php | 6 ++--- .../src/Model/CategoryModel.php | 6 ++--- .../com_checkin/src/Model/CheckinModel.php | 6 ++--- .../src/Controller/ApplicationController.php | 14 +++++------ .../src/Controller/ComponentController.php | 14 +++++------ .../src/Controller/ContactsController.php | 14 +++++------ .../src/Extension/ContactComponent.php | 8 +++---- .../com_contact/src/Table/ContactTable.php | 2 +- .../src/Controller/ArticleController.php | 14 +++++------ .../src/Controller/ArticlesController.php | 14 +++++------ .../src/Extension/ContentComponent.php | 4 ++-- .../com_content/src/Model/ArticleModel.php | 8 +++---- .../com_content/src/Table/FeaturedTable.php | 2 +- .../src/Model/HistoryModel.php | 6 ++--- .../src/Controller/FieldController.php | 14 +++++------ .../src/Controller/GroupController.php | 14 +++++------ .../src/Extension/FieldsComponent.php | 4 ++-- .../com_fields/src/Helper/FieldsHelper.php | 4 ++-- .../com_fields/src/Model/FieldModel.php | 6 ++--- .../com_fields/src/Model/FieldsModel.php | 6 ++--- .../com_fields/src/Model/GroupsModel.php | 6 ++--- .../com_fields/src/Table/FieldTable.php | 8 +++---- .../com_fields/src/Table/GroupTable.php | 8 +++---- .../com_finder/src/Indexer/Helper.php | 2 +- .../com_finder/src/Indexer/Indexer.php | 2 +- .../com_finder/src/Indexer/Query.php | 5 ++-- .../com_finder/src/Model/FiltersModel.php | 2 +- .../com_finder/src/Model/IndexModel.php | 2 +- .../com_finder/src/Model/MapsModel.php | 2 +- .../com_finder/src/Model/SearchesModel.php | 2 +- .../com_finder/src/Table/FilterTable.php | 2 +- .../com_finder/src/Table/LinkTable.php | 2 +- .../com_finder/src/Table/MapTable.php | 2 +- .../com_guidedtours/src/Table/StepTable.php | 2 +- .../com_guidedtours/src/Table/TourTable.php | 2 +- .../src/Controller/ManageController.php | 10 ++++---- .../src/Controller/UpdatesitesController.php | 10 ++++---- .../com_installer/src/Model/DatabaseModel.php | 6 ++--- .../com_installer/src/Model/DiscoverModel.php | 6 ++--- .../src/Model/InstallerModel.php | 6 ++--- .../src/Model/LanguagesModel.php | 6 ++--- .../com_installer/src/Model/ManageModel.php | 6 ++--- .../com_installer/src/Model/UpdateModel.php | 6 ++--- .../src/Model/UpdatesitesModel.php | 6 ++--- .../src/Table/UpdatesiteTable.php | 2 +- .../src/Model/UpdateModel.php | 2 +- .../src/Model/InstalledModel.php | 6 ++--- .../com_languages/src/Model/LanguageModel.php | 6 ++--- .../src/Model/LanguagesModel.php | 6 ++--- .../src/Model/OverridesModel.php | 6 ++--- .../src/Controller/TemplateController.php | 14 +++++------ .../com_mails/src/Table/TemplateTable.php | 2 +- .../src/Provider/ProviderManager.php | 4 ++-- .../src/Controller/ItemsController.php | 10 ++++---- .../com_menus/src/Model/ItemsModel.php | 6 ++--- .../com_menus/src/Model/MenusModel.php | 6 ++--- .../com_messages/src/Model/MessagesModel.php | 6 ++--- .../com_messages/src/Table/MessageTable.php | 2 +- .../src/Extension/NewsfeedsComponent.php | 8 +++---- .../src/Model/NewsfeedsModel.php | 6 ++--- .../com_newsfeeds/src/Table/NewsfeedTable.php | 2 +- .../com_plugins/src/Model/PluginModel.php | 2 +- .../com_plugins/src/Model/PluginsModel.php | 2 +- .../com_privacy/src/Table/ConsentTable.php | 2 +- .../com_privacy/src/Table/RequestTable.php | 2 +- .../com_redirect/src/Model/LinksModel.php | 6 ++--- .../com_redirect/src/Table/LinkTable.php | 2 +- .../com_scheduler/src/Model/TaskModel.php | 8 +++---- .../com_scheduler/src/Model/TasksModel.php | 6 ++--- .../src/Rule/ExecutionRulesRule.php | 2 +- .../com_scheduler/src/Table/TaskTable.php | 2 +- .../com_scheduler/src/Task/Task.php | 2 +- .../com_tags/src/Model/TagsModel.php | 7 +++--- .../com_tags/src/Table/TagTable.php | 2 +- .../src/Controller/TemplateController.php | 10 ++++---- .../com_templates/src/Model/StyleModel.php | 6 ++--- .../com_templates/src/Model/StylesModel.php | 6 ++--- .../src/Model/TemplatesModel.php | 6 ++--- .../com_templates/src/Table/StyleTable.php | 2 +- .../src/Controller/CallbackController.php | 10 ++++---- .../src/Controller/CaptiveController.php | 10 ++++---- .../src/Controller/MethodController.php | 10 ++++---- .../src/Controller/MethodsController.php | 10 ++++---- .../src/Controller/UsersController.php | 8 +++---- .../com_users/src/Model/BackupcodesModel.php | 24 +++++++++---------- .../com_users/src/Model/CaptiveModel.php | 10 ++++---- .../com_users/src/Model/DebuggroupModel.php | 6 ++--- .../com_users/src/Model/DebuguserModel.php | 6 ++--- .../com_users/src/Model/GroupModel.php | 6 ++--- .../com_users/src/Model/GroupsModel.php | 6 ++--- .../com_users/src/Model/LevelsModel.php | 6 ++--- .../com_users/src/Model/MethodModel.php | 4 ++-- .../com_users/src/Model/NotesModel.php | 6 ++--- .../com_users/src/Model/UserModel.php | 6 ++--- .../com_users/src/Model/UsersModel.php | 6 ++--- .../com_users/src/Table/MfaTable.php | 2 +- .../com_users/src/Table/NoteTable.php | 2 +- .../src/Controller/DisplayController.php | 10 ++++---- .../src/Controller/StageController.php | 10 ++++---- .../src/Controller/StagesController.php | 10 ++++---- .../src/Controller/TransitionController.php | 10 ++++---- .../src/Controller/TransitionsController.php | 10 ++++---- .../src/Controller/WorkflowController.php | 10 ++++---- .../src/Controller/WorkflowsController.php | 10 ++++---- .../com_workflow/src/Table/StageTable.php | 8 +++---- .../src/Table/TransitionTable.php | 8 +++---- .../com_workflow/src/Table/WorkflowTable.php | 8 +++---- .../src/Helper/QuickIconHelper.php | 2 +- 116 files changed, 362 insertions(+), 362 deletions(-) diff --git a/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php b/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php index fee0dc2470129..80873249fb37a 100644 --- a/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php +++ b/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php @@ -37,18 +37,18 @@ class ActionlogsController extends AdminController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. + * @param array $config An optional associative array of configuration settings. * Recognized key values include 'name', 'default_task', 'model_path', and * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param ?MVCFactoryInterface $factory The factory. + * @param CMSApplication $app The Application for the dispatcher + * @param Input $input Input * * @since 3.9.0 * * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_associations/src/Model/AssociationsModel.php b/administrator/components/com_associations/src/Model/AssociationsModel.php index 1c9756a3aed34..f17454632d1b7 100644 --- a/administrator/components/com_associations/src/Model/AssociationsModel.php +++ b/administrator/components/com_associations/src/Model/AssociationsModel.php @@ -33,13 +33,13 @@ class AssociationsModel extends ListModel /** * Override parent constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.7 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_banners/src/Controller/BannersController.php b/administrator/components/com_banners/src/Controller/BannersController.php index b3f0b44b5e9a3..4c44abbc47374 100644 --- a/administrator/components/com_banners/src/Controller/BannersController.php +++ b/administrator/components/com_banners/src/Controller/BannersController.php @@ -47,7 +47,7 @@ class BannersController extends AdminController * * @since 3.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_banners/src/Extension/BannersComponent.php b/administrator/components/com_banners/src/Extension/BannersComponent.php index 319ab8011e52a..02dd81d067ae2 100644 --- a/administrator/components/com_banners/src/Extension/BannersComponent.php +++ b/administrator/components/com_banners/src/Extension/BannersComponent.php @@ -75,7 +75,7 @@ public function boot(ContainerInterface $container) * * @since 4.0.0 */ - protected function getTableNameForSection(string $section = null) + protected function getTableNameForSection(?string $section = null) { return 'banners'; } diff --git a/administrator/components/com_banners/src/Table/BannerTable.php b/administrator/components/com_banners/src/Table/BannerTable.php index f0805e909039d..29388eecf588d 100644 --- a/administrator/components/com_banners/src/Table/BannerTable.php +++ b/administrator/components/com_banners/src/Table/BannerTable.php @@ -49,7 +49,7 @@ class BannerTable extends Table implements VersionableTableInterface * * @since 1.5 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { $this->typeAlias = 'com_banners.banner'; diff --git a/administrator/components/com_banners/src/Table/ClientTable.php b/administrator/components/com_banners/src/Table/ClientTable.php index 783304748ad43..5a08c82bb4c79 100644 --- a/administrator/components/com_banners/src/Table/ClientTable.php +++ b/administrator/components/com_banners/src/Table/ClientTable.php @@ -43,7 +43,7 @@ class ClientTable extends Table implements VersionableTableInterface * * @since 1.5 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { $this->typeAlias = 'com_banners.client'; diff --git a/administrator/components/com_categories/src/Controller/CategoryController.php b/administrator/components/com_categories/src/Controller/CategoryController.php index 6ffae68757181..0542c82589113 100644 --- a/administrator/components/com_categories/src/Controller/CategoryController.php +++ b/administrator/components/com_categories/src/Controller/CategoryController.php @@ -43,15 +43,15 @@ class CategoryController extends FormController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface|null $factory The factory. - * @param CMSApplication|null $app The Application for the dispatcher - * @param Input|null $input Input + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 1.6 * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null, CMSApplication $app = null, Input $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_categories/src/Controller/DisplayController.php b/administrator/components/com_categories/src/Controller/DisplayController.php index 9a1901e7fd2df..41e6790a2dfa6 100644 --- a/administrator/components/com_categories/src/Controller/DisplayController.php +++ b/administrator/components/com_categories/src/Controller/DisplayController.php @@ -47,14 +47,14 @@ class DisplayController extends BaseController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface|null $factory The factory. - * @param CMSApplication|null $app The Application for the dispatcher - * @param Input|null $input Input + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 3.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_categories/src/Model/CategoriesModel.php b/administrator/components/com_categories/src/Model/CategoriesModel.php index 0478d443b6ba6..e95024c18f541 100644 --- a/administrator/components/com_categories/src/Model/CategoriesModel.php +++ b/administrator/components/com_categories/src/Model/CategoriesModel.php @@ -43,12 +43,12 @@ class CategoriesModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface|null $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_categories/src/Model/CategoryModel.php b/administrator/components/com_categories/src/Model/CategoryModel.php index 6e586b745332e..e5bcbb2ac547f 100644 --- a/administrator/components/com_categories/src/Model/CategoryModel.php +++ b/administrator/components/com_categories/src/Model/CategoryModel.php @@ -82,13 +82,13 @@ class CategoryModel extends AdminModel /** * Override parent constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface|null $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { $extension = Factory::getApplication()->getInput()->get('extension', 'com_content'); $this->typeAlias = $extension . '.category'; diff --git a/administrator/components/com_checkin/src/Model/CheckinModel.php b/administrator/components/com_checkin/src/Model/CheckinModel.php index 1acd85183f8af..50e663de3accb 100644 --- a/administrator/components/com_checkin/src/Model/CheckinModel.php +++ b/administrator/components/com_checkin/src/Model/CheckinModel.php @@ -36,13 +36,13 @@ class CheckinModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_config/src/Controller/ApplicationController.php b/administrator/components/com_config/src/Controller/ApplicationController.php index 3e8c3bc952f61..eb33421783efb 100644 --- a/administrator/components/com_config/src/Controller/ApplicationController.php +++ b/administrator/components/com_config/src/Controller/ApplicationController.php @@ -34,16 +34,16 @@ class ApplicationController extends BaseController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 3.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_config/src/Controller/ComponentController.php b/administrator/components/com_config/src/Controller/ComponentController.php index 903df53806965..f7abd791c87c2 100644 --- a/administrator/components/com_config/src/Controller/ComponentController.php +++ b/administrator/components/com_config/src/Controller/ComponentController.php @@ -32,16 +32,16 @@ class ComponentController extends FormController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 3.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_contact/src/Controller/ContactsController.php b/administrator/components/com_contact/src/Controller/ContactsController.php index 6e141bcc45da1..3c44571dfb671 100644 --- a/administrator/components/com_contact/src/Controller/ContactsController.php +++ b/administrator/components/com_contact/src/Controller/ContactsController.php @@ -32,16 +32,16 @@ class ContactsController extends AdminController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 3.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_contact/src/Extension/ContactComponent.php b/administrator/components/com_contact/src/Extension/ContactComponent.php index d4402a1060031..7016c7503687a 100644 --- a/administrator/components/com_contact/src/Extension/ContactComponent.php +++ b/administrator/components/com_contact/src/Extension/ContactComponent.php @@ -134,13 +134,13 @@ public function getContexts(): array /** * Returns the table for the count items functions for the given section. * - * @param string $section The section + * @param ?string $section The section * * @return string|null * * @since 4.0.0 */ - protected function getTableNameForSection(string $section = null) + protected function getTableNameForSection(?string $section = null) { return ($section === 'category' ? 'categories' : 'contact_details'); } @@ -148,13 +148,13 @@ protected function getTableNameForSection(string $section = null) /** * Returns the state column for the count items functions for the given section. * - * @param string $section The section + * @param ?string $section The section * * @return string|null * * @since 4.0.0 */ - protected function getStateColumnForSection(string $section = null) + protected function getStateColumnForSection(?string $section = null) { return 'published'; } diff --git a/administrator/components/com_contact/src/Table/ContactTable.php b/administrator/components/com_contact/src/Table/ContactTable.php index 15d73d0588a11..fd00fb5909128 100644 --- a/administrator/components/com_contact/src/Table/ContactTable.php +++ b/administrator/components/com_contact/src/Table/ContactTable.php @@ -63,7 +63,7 @@ class ContactTable extends Table implements VersionableTableInterface, TaggableT * * @since 1.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { $this->typeAlias = 'com_contact.contact'; diff --git a/administrator/components/com_content/src/Controller/ArticleController.php b/administrator/components/com_content/src/Controller/ArticleController.php index 4e42f26a2a882..abffcfed2f15b 100644 --- a/administrator/components/com_content/src/Controller/ArticleController.php +++ b/administrator/components/com_content/src/Controller/ArticleController.php @@ -35,16 +35,16 @@ class ArticleController extends FormController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 3.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_content/src/Controller/ArticlesController.php b/administrator/components/com_content/src/Controller/ArticlesController.php index 0fc54328e6439..dc86b71f090e5 100644 --- a/administrator/components/com_content/src/Controller/ArticlesController.php +++ b/administrator/components/com_content/src/Controller/ArticlesController.php @@ -33,16 +33,16 @@ class ArticlesController extends AdminController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 3.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_content/src/Extension/ContentComponent.php b/administrator/components/com_content/src/Extension/ContentComponent.php index 092b7396a8066..745bbc2be3955 100644 --- a/administrator/components/com_content/src/Extension/ContentComponent.php +++ b/administrator/components/com_content/src/Extension/ContentComponent.php @@ -241,13 +241,13 @@ public function getCategoryWorkflowContext(?string $section = null): string /** * Returns the table for the count items functions for the given section. * - * @param string $section The section + * @param ?string $section The section * * @return string|null * * @since 4.0.0 */ - protected function getTableNameForSection(string $section = null) + protected function getTableNameForSection(?string $section = null) { return '#__content'; } diff --git a/administrator/components/com_content/src/Model/ArticleModel.php b/administrator/components/com_content/src/Model/ArticleModel.php index c4c5e0114ce6f..6474be7a2753f 100644 --- a/administrator/components/com_content/src/Model/ArticleModel.php +++ b/administrator/components/com_content/src/Model/ArticleModel.php @@ -97,14 +97,14 @@ class ArticleModel extends AdminModel implements WorkflowModelInterface /** * Constructor. * - * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). - * @param MVCFactoryInterface $factory The factory. - * @param FormFactoryInterface $formFactory The form factory. + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?FormFactoryInterface $formFactory The form factory. * * @since 1.6 * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null, FormFactoryInterface $formFactory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?FormFactoryInterface $formFactory = null) { $config['events_map'] = $config['events_map'] ?? []; diff --git a/administrator/components/com_content/src/Table/FeaturedTable.php b/administrator/components/com_content/src/Table/FeaturedTable.php index 7328ac2eb47c0..89c4dbf3f29bf 100644 --- a/administrator/components/com_content/src/Table/FeaturedTable.php +++ b/administrator/components/com_content/src/Table/FeaturedTable.php @@ -33,7 +33,7 @@ class FeaturedTable extends Table * * @since 1.6 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__content_frontpage', 'content_id', $db, $dispatcher); } diff --git a/administrator/components/com_contenthistory/src/Model/HistoryModel.php b/administrator/components/com_contenthistory/src/Model/HistoryModel.php index 1dea5ec5159fa..4e42dea1a3081 100644 --- a/administrator/components/com_contenthistory/src/Model/HistoryModel.php +++ b/administrator/components/com_contenthistory/src/Model/HistoryModel.php @@ -37,13 +37,13 @@ class HistoryModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_fields/src/Controller/FieldController.php b/administrator/components/com_fields/src/Controller/FieldController.php index 4c1950afac55e..24682c186ce79 100644 --- a/administrator/components/com_fields/src/Controller/FieldController.php +++ b/administrator/components/com_fields/src/Controller/FieldController.php @@ -51,16 +51,16 @@ class FieldController extends FormController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 3.7.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_fields/src/Controller/GroupController.php b/administrator/components/com_fields/src/Controller/GroupController.php index 2e4d6e23682a8..6572227d11fe3 100644 --- a/administrator/components/com_fields/src/Controller/GroupController.php +++ b/administrator/components/com_fields/src/Controller/GroupController.php @@ -49,16 +49,16 @@ class GroupController extends FormController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 3.7.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_fields/src/Extension/FieldsComponent.php b/administrator/components/com_fields/src/Extension/FieldsComponent.php index f95d4fabcc0d1..4db83fb07a27b 100644 --- a/administrator/components/com_fields/src/Extension/FieldsComponent.php +++ b/administrator/components/com_fields/src/Extension/FieldsComponent.php @@ -30,13 +30,13 @@ class FieldsComponent extends MVCComponent implements CategoryServiceInterface /** * Returns the table for the count items functions for the given section. * - * @param string $section The section + * @param ?string $section The section * * @return string|null * * @since 4.0.0 */ - protected function getTableNameForSection(string $section = null) + protected function getTableNameForSection(?string $section = null) { return 'fields'; } diff --git a/administrator/components/com_fields/src/Helper/FieldsHelper.php b/administrator/components/com_fields/src/Helper/FieldsHelper.php index 5f83985de0d1a..117f0452b8829 100644 --- a/administrator/components/com_fields/src/Helper/FieldsHelper.php +++ b/administrator/components/com_fields/src/Helper/FieldsHelper.php @@ -100,7 +100,7 @@ public static function extract($contextString, $item = null) * @param string $context The context of the content passed to the helper * @param object|array|null $item The item being edited in the form * @param int|bool $prepareValue (if int is display event): 1 - AfterTitle, 2 - BeforeDisplay, 3 - AfterDisplay, 0 - OFF - * @param array|null $valuesToOverride The values to override + * @param ?array $valuesToOverride The values to override * @param bool $includeSubformFields Should I include fields marked as Only Use In Subform? * * @return array @@ -112,7 +112,7 @@ public static function getFields( $context, $item = null, $prepareValue = false, - array $valuesToOverride = null, + ?array $valuesToOverride = null, bool $includeSubformFields = false ) { if (self::$fieldsCache === null) { diff --git a/administrator/components/com_fields/src/Model/FieldModel.php b/administrator/components/com_fields/src/Model/FieldModel.php index 9b1a84afb4121..6cb181df23a4d 100644 --- a/administrator/components/com_fields/src/Model/FieldModel.php +++ b/administrator/components/com_fields/src/Model/FieldModel.php @@ -87,13 +87,13 @@ class FieldModel extends AdminModel /** * Constructor * - * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). - * @param MVCFactoryInterface $factory The factory. + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. * * @since 3.7.0 * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { parent::__construct($config, $factory); diff --git a/administrator/components/com_fields/src/Model/FieldsModel.php b/administrator/components/com_fields/src/Model/FieldsModel.php index 9059b892bdf43..5b45fc0ddbd59 100644 --- a/administrator/components/com_fields/src/Model/FieldsModel.php +++ b/administrator/components/com_fields/src/Model/FieldsModel.php @@ -34,13 +34,13 @@ class FieldsModel extends ListModel /** * Constructor * - * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). - * @param MVCFactoryInterface $factory The factory. + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. * * @since 3.7.0 * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_fields/src/Model/GroupsModel.php b/administrator/components/com_fields/src/Model/GroupsModel.php index 725c0d2252456..662409540cf16 100644 --- a/administrator/components/com_fields/src/Model/GroupsModel.php +++ b/administrator/components/com_fields/src/Model/GroupsModel.php @@ -39,13 +39,13 @@ class GroupsModel extends ListModel /** * Constructor * - * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). - * @param MVCFactoryInterface $factory The factory. + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. * * @since 3.7.0 * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_fields/src/Table/FieldTable.php b/administrator/components/com_fields/src/Table/FieldTable.php index b40fd9524c8cd..ddd04bda42009 100644 --- a/administrator/components/com_fields/src/Table/FieldTable.php +++ b/administrator/components/com_fields/src/Table/FieldTable.php @@ -51,7 +51,7 @@ class FieldTable extends Table implements CurrentUserInterface * * @since 3.7.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__fields', 'id', $db, $dispatcher); @@ -258,14 +258,14 @@ protected function _getAssetTitle() * The extended class can define a table and id to lookup. If the * asset does not exist it will be created. * - * @param Table $table A Table object for the asset parent. - * @param integer $id Id to look up + * @param ?Table $table A Table object for the asset parent. + * @param integer $id Id to look up * * @return integer * * @since 3.7.0 */ - protected function _getAssetParentId(Table $table = null, $id = null) + protected function _getAssetParentId(?Table $table = null, $id = null) { $contextArray = explode('.', $this->context); $component = $contextArray[0]; diff --git a/administrator/components/com_fields/src/Table/GroupTable.php b/administrator/components/com_fields/src/Table/GroupTable.php index e153f289ed0c0..6decabfbafca5 100644 --- a/administrator/components/com_fields/src/Table/GroupTable.php +++ b/administrator/components/com_fields/src/Table/GroupTable.php @@ -49,7 +49,7 @@ class GroupTable extends Table implements CurrentUserInterface * * @since 3.7.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__fields_groups', 'id', $db, $dispatcher); @@ -193,14 +193,14 @@ protected function _getAssetTitle() * The extended class can define a table and id to lookup. If the * asset does not exist it will be created. * - * @param Table $table A Table object for the asset parent. - * @param integer $id Id to look up + * @param ?Table $table A Table object for the asset parent. + * @param integer $id Id to look up * * @return integer * * @since 3.7.0 */ - protected function _getAssetParentId(Table $table = null, $id = null) + protected function _getAssetParentId(?Table $table = null, $id = null) { $component = explode('.', $this->context); $db = $this->getDbo(); diff --git a/administrator/components/com_finder/src/Indexer/Helper.php b/administrator/components/com_finder/src/Indexer/Helper.php index ab625c476bd8e..0590163968e1b 100644 --- a/administrator/components/com_finder/src/Indexer/Helper.php +++ b/administrator/components/com_finder/src/Indexer/Helper.php @@ -447,7 +447,7 @@ public static function addCustomFields(Result $item, $context) * * @since 2.5 */ - public static function prepareContent($text, $params = null, Result $item = null) + public static function prepareContent($text, $params = null, ?Result $item = null) { static $loaded; diff --git a/administrator/components/com_finder/src/Indexer/Indexer.php b/administrator/components/com_finder/src/Indexer/Indexer.php index 22ba7c85a8e63..fb97cd0af9dcd 100644 --- a/administrator/components/com_finder/src/Indexer/Indexer.php +++ b/administrator/components/com_finder/src/Indexer/Indexer.php @@ -119,7 +119,7 @@ class Indexer * * @since 3.8.0 */ - public function __construct(DatabaseInterface $db = null) + public function __construct(?DatabaseInterface $db = null) { if ($db === null) { @trigger_error(sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED); diff --git a/administrator/components/com_finder/src/Indexer/Query.php b/administrator/components/com_finder/src/Indexer/Query.php index 7a92521c3a1a6..163ae175ba947 100644 --- a/administrator/components/com_finder/src/Indexer/Query.php +++ b/administrator/components/com_finder/src/Indexer/Query.php @@ -199,12 +199,13 @@ class Query /** * Method to instantiate the query object. * - * @param array $options An array of query options. + * @param array $options An array of query options. + * @param ?DatabaseInterface $db The database * * @since 2.5 * @throws \Exception on database error. */ - public function __construct($options, DatabaseInterface $db = null) + public function __construct($options, ?DatabaseInterface $db = null) { if ($db === null) { @trigger_error(sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED); diff --git a/administrator/components/com_finder/src/Model/FiltersModel.php b/administrator/components/com_finder/src/Model/FiltersModel.php index 4c64d31da46d5..43836c7d67347 100644 --- a/administrator/components/com_finder/src/Model/FiltersModel.php +++ b/administrator/components/com_finder/src/Model/FiltersModel.php @@ -34,7 +34,7 @@ class FiltersModel extends ListModel * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.7 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_finder/src/Model/IndexModel.php b/administrator/components/com_finder/src/Model/IndexModel.php index 75ea94cbcffa7..d0db5fdcf8300 100644 --- a/administrator/components/com_finder/src/Model/IndexModel.php +++ b/administrator/components/com_finder/src/Model/IndexModel.php @@ -61,7 +61,7 @@ class IndexModel extends ListModel * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.7 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_finder/src/Model/MapsModel.php b/administrator/components/com_finder/src/Model/MapsModel.php index b256927f00087..933541475782a 100644 --- a/administrator/components/com_finder/src/Model/MapsModel.php +++ b/administrator/components/com_finder/src/Model/MapsModel.php @@ -38,7 +38,7 @@ class MapsModel extends ListModel * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.7 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_finder/src/Model/SearchesModel.php b/administrator/components/com_finder/src/Model/SearchesModel.php index 69399be23d460..e9b0a668b4352 100644 --- a/administrator/components/com_finder/src/Model/SearchesModel.php +++ b/administrator/components/com_finder/src/Model/SearchesModel.php @@ -34,7 +34,7 @@ class SearchesModel extends ListModel * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 4.0.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_finder/src/Table/FilterTable.php b/administrator/components/com_finder/src/Table/FilterTable.php index e1e415a2e841d..6c352635379ab 100644 --- a/administrator/components/com_finder/src/Table/FilterTable.php +++ b/administrator/components/com_finder/src/Table/FilterTable.php @@ -57,7 +57,7 @@ class FilterTable extends Table implements CurrentUserInterface * * @since 2.5 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__finder_filters', 'filter_id', $db, $dispatcher); diff --git a/administrator/components/com_finder/src/Table/LinkTable.php b/administrator/components/com_finder/src/Table/LinkTable.php index 9400f72dc339c..4c93c50437693 100644 --- a/administrator/components/com_finder/src/Table/LinkTable.php +++ b/administrator/components/com_finder/src/Table/LinkTable.php @@ -41,7 +41,7 @@ class LinkTable extends Table * * @since 2.5 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__finder_links', 'link_id', $db, $dispatcher); } diff --git a/administrator/components/com_finder/src/Table/MapTable.php b/administrator/components/com_finder/src/Table/MapTable.php index ef90337062b83..9f3dada7cdcda 100644 --- a/administrator/components/com_finder/src/Table/MapTable.php +++ b/administrator/components/com_finder/src/Table/MapTable.php @@ -36,7 +36,7 @@ class MapTable extends Nested * * @since 2.5 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__finder_taxonomy', 'id', $db, $dispatcher); diff --git a/administrator/components/com_guidedtours/src/Table/StepTable.php b/administrator/components/com_guidedtours/src/Table/StepTable.php index 0af696921e63c..777bacd8183b4 100644 --- a/administrator/components/com_guidedtours/src/Table/StepTable.php +++ b/administrator/components/com_guidedtours/src/Table/StepTable.php @@ -47,7 +47,7 @@ class StepTable extends Table implements CurrentUserInterface * * @since 4.3.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__guidedtour_steps', 'id', $db, $dispatcher); } diff --git a/administrator/components/com_guidedtours/src/Table/TourTable.php b/administrator/components/com_guidedtours/src/Table/TourTable.php index 8d10c264f3049..98d739a7fce62 100644 --- a/administrator/components/com_guidedtours/src/Table/TourTable.php +++ b/administrator/components/com_guidedtours/src/Table/TourTable.php @@ -57,7 +57,7 @@ class TourTable extends Table implements CurrentUserInterface * * @since 4.3.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__guidedtours', 'id', $db, $dispatcher); } diff --git a/administrator/components/com_installer/src/Controller/ManageController.php b/administrator/components/com_installer/src/Controller/ManageController.php index bfbc9c1895378..27cb7b9cd4656 100644 --- a/administrator/components/com_installer/src/Controller/ManageController.php +++ b/administrator/components/com_installer/src/Controller/ManageController.php @@ -34,14 +34,14 @@ class ManageController extends BaseController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_installer/src/Controller/UpdatesitesController.php b/administrator/components/com_installer/src/Controller/UpdatesitesController.php index 0eea827352c4f..07f0271187b38 100644 --- a/administrator/components/com_installer/src/Controller/UpdatesitesController.php +++ b/administrator/components/com_installer/src/Controller/UpdatesitesController.php @@ -42,14 +42,14 @@ class UpdatesitesController extends AdminController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_installer/src/Model/DatabaseModel.php b/administrator/components/com_installer/src/Model/DatabaseModel.php index d3c7dd63f7d98..7d1579240bbab 100644 --- a/administrator/components/com_installer/src/Model/DatabaseModel.php +++ b/administrator/components/com_installer/src/Model/DatabaseModel.php @@ -63,13 +63,13 @@ class DatabaseModel extends InstallerModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see ListModel * @since 4.0.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_installer/src/Model/DiscoverModel.php b/administrator/components/com_installer/src/Model/DiscoverModel.php index 26cfc37974906..38401c618de11 100644 --- a/administrator/components/com_installer/src/Model/DiscoverModel.php +++ b/administrator/components/com_installer/src/Model/DiscoverModel.php @@ -33,13 +33,13 @@ class DiscoverModel extends InstallerModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\ListModel * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_installer/src/Model/InstallerModel.php b/administrator/components/com_installer/src/Model/InstallerModel.php index e57297043d0f2..fd263b2bd5353 100644 --- a/administrator/components/com_installer/src/Model/InstallerModel.php +++ b/administrator/components/com_installer/src/Model/InstallerModel.php @@ -31,13 +31,13 @@ class InstallerModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\ListModel * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_installer/src/Model/LanguagesModel.php b/administrator/components/com_installer/src/Model/LanguagesModel.php index 39f381c03fe31..63e8a689045a5 100644 --- a/administrator/components/com_installer/src/Model/LanguagesModel.php +++ b/administrator/components/com_installer/src/Model/LanguagesModel.php @@ -38,13 +38,13 @@ class LanguagesModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\ListModel * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_installer/src/Model/ManageModel.php b/administrator/components/com_installer/src/Model/ManageModel.php index d6c6e954d5d88..8ba1d8ee517a6 100644 --- a/administrator/components/com_installer/src/Model/ManageModel.php +++ b/administrator/components/com_installer/src/Model/ManageModel.php @@ -38,13 +38,13 @@ class ManageModel extends InstallerModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\ListModel * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_installer/src/Model/UpdateModel.php b/administrator/components/com_installer/src/Model/UpdateModel.php index 17431af5ed004..cd37e1e2a03bf 100644 --- a/administrator/components/com_installer/src/Model/UpdateModel.php +++ b/administrator/components/com_installer/src/Model/UpdateModel.php @@ -40,13 +40,13 @@ class UpdateModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\ListModel * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_installer/src/Model/UpdatesitesModel.php b/administrator/components/com_installer/src/Model/UpdatesitesModel.php index 0ade2440207dd..dc45c851e4d36 100644 --- a/administrator/components/com_installer/src/Model/UpdatesitesModel.php +++ b/administrator/components/com_installer/src/Model/UpdatesitesModel.php @@ -36,13 +36,13 @@ class UpdatesitesModel extends InstallerModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @since 1.6 * @see \Joomla\CMS\MVC\Model\ListModel */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_installer/src/Table/UpdatesiteTable.php b/administrator/components/com_installer/src/Table/UpdatesiteTable.php index 31e3e0f2bc1d9..00d991866e39c 100644 --- a/administrator/components/com_installer/src/Table/UpdatesiteTable.php +++ b/administrator/components/com_installer/src/Table/UpdatesiteTable.php @@ -42,7 +42,7 @@ class UpdatesiteTable extends Table * * @since 4.0.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { $this->typeAlias = 'com_installer.downloadkey'; diff --git a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php index 5b2bc74f08d0a..3a18fcde5d088 100644 --- a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php +++ b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php @@ -62,7 +62,7 @@ class UpdateModel extends BaseDatabaseModel * @since 4.4.0 * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { parent::__construct($config, $factory); diff --git a/administrator/components/com_languages/src/Model/InstalledModel.php b/administrator/components/com_languages/src/Model/InstalledModel.php index 60a3683f3dd9a..e33e1ba7b5aea 100644 --- a/administrator/components/com_languages/src/Model/InstalledModel.php +++ b/administrator/components/com_languages/src/Model/InstalledModel.php @@ -60,13 +60,13 @@ class InstalledModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_languages/src/Model/LanguageModel.php b/administrator/components/com_languages/src/Model/LanguageModel.php index ff7f56fb5fa00..5c191be729218 100644 --- a/administrator/components/com_languages/src/Model/LanguageModel.php +++ b/administrator/components/com_languages/src/Model/LanguageModel.php @@ -35,13 +35,13 @@ class LanguageModel extends AdminModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { $config = array_merge( [ diff --git a/administrator/components/com_languages/src/Model/LanguagesModel.php b/administrator/components/com_languages/src/Model/LanguagesModel.php index 43949a3d2f2da..39a8b6a4425be 100644 --- a/administrator/components/com_languages/src/Model/LanguagesModel.php +++ b/administrator/components/com_languages/src/Model/LanguagesModel.php @@ -31,13 +31,13 @@ class LanguagesModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_languages/src/Model/OverridesModel.php b/administrator/components/com_languages/src/Model/OverridesModel.php index c05d9e5b511ce..bb26ee94c3f03 100644 --- a/administrator/components/com_languages/src/Model/OverridesModel.php +++ b/administrator/components/com_languages/src/Model/OverridesModel.php @@ -31,13 +31,13 @@ class OverridesModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 2.5 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_mails/src/Controller/TemplateController.php b/administrator/components/com_mails/src/Controller/TemplateController.php index 73749eaee8fb3..2aacd0d818ed8 100644 --- a/administrator/components/com_mails/src/Controller/TemplateController.php +++ b/administrator/components/com_mails/src/Controller/TemplateController.php @@ -34,17 +34,17 @@ class TemplateController extends FormController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 4.0.0 * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_mails/src/Table/TemplateTable.php b/administrator/components/com_mails/src/Table/TemplateTable.php index 5a9d958ee2669..549527426c66c 100644 --- a/administrator/components/com_mails/src/Table/TemplateTable.php +++ b/administrator/components/com_mails/src/Table/TemplateTable.php @@ -41,7 +41,7 @@ class TemplateTable extends Table * * @since 4.0.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__mail_templates', ['template_id', 'language'], $db, $dispatcher); } diff --git a/administrator/components/com_media/src/Provider/ProviderManager.php b/administrator/components/com_media/src/Provider/ProviderManager.php index 6f83dbbbfbc59..b14c94b8e0cc7 100644 --- a/administrator/components/com_media/src/Provider/ProviderManager.php +++ b/administrator/components/com_media/src/Provider/ProviderManager.php @@ -63,13 +63,13 @@ public function registerProvider(ProviderInterface $provider) * Unregister a provider from the ProviderManager. * When no provider, or null is passed in, then all providers are cleared. * - * @param ProviderInterface|null $provider The provider to be unregistered + * @param ?ProviderInterface $provider The provider to be unregistered * * @return void * * @since 4.0.6 */ - public function unregisterProvider(ProviderInterface $provider = null): void + public function unregisterProvider(?ProviderInterface $provider = null): void { if ($provider === null) { $this->providers = []; diff --git a/administrator/components/com_menus/src/Controller/ItemsController.php b/administrator/components/com_menus/src/Controller/ItemsController.php index edf355ff7e8b0..41e8ccd57aba5 100644 --- a/administrator/components/com_menus/src/Controller/ItemsController.php +++ b/administrator/components/com_menus/src/Controller/ItemsController.php @@ -34,14 +34,14 @@ class ItemsController extends AdminController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_menus/src/Model/ItemsModel.php b/administrator/components/com_menus/src/Model/ItemsModel.php index b55ee807863ac..006259dde2dd4 100644 --- a/administrator/components/com_menus/src/Model/ItemsModel.php +++ b/administrator/components/com_menus/src/Model/ItemsModel.php @@ -34,13 +34,13 @@ class ItemsModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_menus/src/Model/MenusModel.php b/administrator/components/com_menus/src/Model/MenusModel.php index 16a538a34bcdc..da6602855ceee 100644 --- a/administrator/components/com_menus/src/Model/MenusModel.php +++ b/administrator/components/com_menus/src/Model/MenusModel.php @@ -31,13 +31,13 @@ class MenusModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_messages/src/Model/MessagesModel.php b/administrator/components/com_messages/src/Model/MessagesModel.php index 0d2494ce3ead9..81a09b7351026 100644 --- a/administrator/components/com_messages/src/Model/MessagesModel.php +++ b/administrator/components/com_messages/src/Model/MessagesModel.php @@ -29,13 +29,13 @@ class MessagesModel extends ListModel /** * Override parent constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_messages/src/Table/MessageTable.php b/administrator/components/com_messages/src/Table/MessageTable.php index b427ffe45aa97..14a84956357b2 100644 --- a/administrator/components/com_messages/src/Table/MessageTable.php +++ b/administrator/components/com_messages/src/Table/MessageTable.php @@ -35,7 +35,7 @@ class MessageTable extends Table * * @since 1.5 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__messages', 'message_id', $db, $dispatcher); diff --git a/administrator/components/com_newsfeeds/src/Extension/NewsfeedsComponent.php b/administrator/components/com_newsfeeds/src/Extension/NewsfeedsComponent.php index e1cbcad907f57..b89a97ca15827 100644 --- a/administrator/components/com_newsfeeds/src/Extension/NewsfeedsComponent.php +++ b/administrator/components/com_newsfeeds/src/Extension/NewsfeedsComponent.php @@ -69,13 +69,13 @@ public function boot(ContainerInterface $container) /** * Returns the table for the count items functions for the given section. * - * @param string $section The section + * @param ?string $section The section * * @return string|null * * @since 4.0.0 */ - protected function getTableNameForSection(string $section = null) + protected function getTableNameForSection(?string $section = null) { return $section === 'category' ? 'categories' : 'newsfeeds'; } @@ -83,13 +83,13 @@ protected function getTableNameForSection(string $section = null) /** * Returns the state column for the count items functions for the given section. * - * @param string $section The section + * @param ?string $section The section * * @return string|null * * @since 4.0.0 */ - protected function getStateColumnForSection(string $section = null) + protected function getStateColumnForSection(?string $section = null) { return 'published'; } diff --git a/administrator/components/com_newsfeeds/src/Model/NewsfeedsModel.php b/administrator/components/com_newsfeeds/src/Model/NewsfeedsModel.php index 255df9768b804..2e1dd6880871f 100644 --- a/administrator/components/com_newsfeeds/src/Model/NewsfeedsModel.php +++ b/administrator/components/com_newsfeeds/src/Model/NewsfeedsModel.php @@ -32,13 +32,13 @@ class NewsfeedsModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_newsfeeds/src/Table/NewsfeedTable.php b/administrator/components/com_newsfeeds/src/Table/NewsfeedTable.php index 327afc27bbd08..f2469f401ad05 100644 --- a/administrator/components/com_newsfeeds/src/Table/NewsfeedTable.php +++ b/administrator/components/com_newsfeeds/src/Table/NewsfeedTable.php @@ -62,7 +62,7 @@ class NewsfeedTable extends Table implements VersionableTableInterface, Taggable * * @since 1.6 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { $this->typeAlias = 'com_newsfeeds.newsfeed'; parent::__construct('#__newsfeeds', 'id', $db, $dispatcher); diff --git a/administrator/components/com_plugins/src/Model/PluginModel.php b/administrator/components/com_plugins/src/Model/PluginModel.php index b4284a637c81f..c12192d5dbd91 100644 --- a/administrator/components/com_plugins/src/Model/PluginModel.php +++ b/administrator/components/com_plugins/src/Model/PluginModel.php @@ -60,7 +60,7 @@ class PluginModel extends AdminModel * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { $config = array_merge( [ diff --git a/administrator/components/com_plugins/src/Model/PluginsModel.php b/administrator/components/com_plugins/src/Model/PluginsModel.php index 6631da01185c4..d9687554211a8 100644 --- a/administrator/components/com_plugins/src/Model/PluginsModel.php +++ b/administrator/components/com_plugins/src/Model/PluginsModel.php @@ -39,7 +39,7 @@ class PluginsModel extends ListModel * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_privacy/src/Table/ConsentTable.php b/administrator/components/com_privacy/src/Table/ConsentTable.php index 1d60521fc9502..e937c0c68b6b1 100644 --- a/administrator/components/com_privacy/src/Table/ConsentTable.php +++ b/administrator/components/com_privacy/src/Table/ConsentTable.php @@ -39,7 +39,7 @@ class ConsentTable extends Table * * @since 3.9.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__privacy_consents', 'id', $db, $dispatcher); } diff --git a/administrator/components/com_privacy/src/Table/RequestTable.php b/administrator/components/com_privacy/src/Table/RequestTable.php index deee846c6f8cf..c58ea8aba7d92 100644 --- a/administrator/components/com_privacy/src/Table/RequestTable.php +++ b/administrator/components/com_privacy/src/Table/RequestTable.php @@ -50,7 +50,7 @@ class RequestTable extends Table * * @since 3.9.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__privacy_requests', 'id', $db, $dispatcher); } diff --git a/administrator/components/com_redirect/src/Model/LinksModel.php b/administrator/components/com_redirect/src/Model/LinksModel.php index 042e4314d84df..ad8bba780afb5 100644 --- a/administrator/components/com_redirect/src/Model/LinksModel.php +++ b/administrator/components/com_redirect/src/Model/LinksModel.php @@ -30,12 +30,12 @@ class LinksModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_redirect/src/Table/LinkTable.php b/administrator/components/com_redirect/src/Table/LinkTable.php index c8c4b3cbe8fdb..926d352fea1a2 100644 --- a/administrator/components/com_redirect/src/Table/LinkTable.php +++ b/administrator/components/com_redirect/src/Table/LinkTable.php @@ -36,7 +36,7 @@ class LinkTable extends Table * * @since 1.6 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__redirect_links', 'id', $db, $dispatcher); } diff --git a/administrator/components/com_scheduler/src/Model/TaskModel.php b/administrator/components/com_scheduler/src/Model/TaskModel.php index 34bc81ed544d4..8fe033cee850c 100644 --- a/administrator/components/com_scheduler/src/Model/TaskModel.php +++ b/administrator/components/com_scheduler/src/Model/TaskModel.php @@ -109,14 +109,14 @@ class TaskModel extends AdminModel /** * TaskModel constructor. Needed just to set $app * - * @param array $config An array of configuration options - * @param MVCFactoryInterface|null $factory The factory - * @param FormFactoryInterface|null $formFactory The form factory + * @param array $config An array of configuration options + * @param ?MVCFactoryInterface $factory The factory + * @param ?FormFactoryInterface $formFactory The form factory * * @since 4.1.0 * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null, FormFactoryInterface $formFactory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?FormFactoryInterface $formFactory = null) { $config['events_map'] = $config['events_map'] ?? []; diff --git a/administrator/components/com_scheduler/src/Model/TasksModel.php b/administrator/components/com_scheduler/src/Model/TasksModel.php index 2e80dc4b92e29..5b815fd672777 100644 --- a/administrator/components/com_scheduler/src/Model/TasksModel.php +++ b/administrator/components/com_scheduler/src/Model/TasksModel.php @@ -39,14 +39,14 @@ class TasksModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface|null $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @since 4.1.0 * @throws \Exception * @see \JControllerLegacy */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_scheduler/src/Rule/ExecutionRulesRule.php b/administrator/components/com_scheduler/src/Rule/ExecutionRulesRule.php index 9515ec5803e72..4e0fd7eb50967 100644 --- a/administrator/components/com_scheduler/src/Rule/ExecutionRulesRule.php +++ b/administrator/components/com_scheduler/src/Rule/ExecutionRulesRule.php @@ -54,7 +54,7 @@ class ExecutionRulesRule extends FormRule * * @since 4.1.0 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null): bool + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null): bool { $fieldName = (string) $element['name']; $ruleType = $input->get(self::RULE_TYPE_FIELD); diff --git a/administrator/components/com_scheduler/src/Table/TaskTable.php b/administrator/components/com_scheduler/src/Table/TaskTable.php index 5a778142d7e22..bbf983371eac9 100644 --- a/administrator/components/com_scheduler/src/Table/TaskTable.php +++ b/administrator/components/com_scheduler/src/Table/TaskTable.php @@ -82,7 +82,7 @@ class TaskTable extends Table implements CurrentUserInterface * * @since 4.1.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { $this->setColumnAlias('published', 'state'); diff --git a/administrator/components/com_scheduler/src/Task/Task.php b/administrator/components/com_scheduler/src/Task/Task.php index 931033aea1e11..bfd16a0989658 100644 --- a/administrator/components/com_scheduler/src/Task/Task.php +++ b/administrator/components/com_scheduler/src/Task/Task.php @@ -498,7 +498,7 @@ public function isSuccess(): bool * * @since 4.1.0 */ - protected function set(string $path, $value, string $separator = null) + protected function set(string $path, $value, ?string $separator = null) { return $this->taskRegistry->set($path, $value, $separator); } diff --git a/administrator/components/com_tags/src/Model/TagsModel.php b/administrator/components/com_tags/src/Model/TagsModel.php index 409308621cf9e..b8d5b56ccfb8e 100644 --- a/administrator/components/com_tags/src/Model/TagsModel.php +++ b/administrator/components/com_tags/src/Model/TagsModel.php @@ -32,13 +32,12 @@ class TagsModel extends ListModel /** * Constructor. * - * @param MVCFactoryInterface $factory The factory. - * - * @param array $config An optional associative array of configuration settings. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_tags/src/Table/TagTable.php b/administrator/components/com_tags/src/Table/TagTable.php index 76eaad2d792f9..9eee2e3c02bc9 100644 --- a/administrator/components/com_tags/src/Table/TagTable.php +++ b/administrator/components/com_tags/src/Table/TagTable.php @@ -59,7 +59,7 @@ class TagTable extends Nested implements VersionableTableInterface, CurrentUserI * * @since 3.1.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { $this->typeAlias = 'com_tags.tag'; diff --git a/administrator/components/com_templates/src/Controller/TemplateController.php b/administrator/components/com_templates/src/Controller/TemplateController.php index ac762181275d1..6a45658344ba7 100644 --- a/administrator/components/com_templates/src/Controller/TemplateController.php +++ b/administrator/components/com_templates/src/Controller/TemplateController.php @@ -37,15 +37,15 @@ class TemplateController extends BaseController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 1.6 * @see BaseController */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_templates/src/Model/StyleModel.php b/administrator/components/com_templates/src/Model/StyleModel.php index 0d8984b4b262e..bb381388aea5e 100644 --- a/administrator/components/com_templates/src/Model/StyleModel.php +++ b/administrator/components/com_templates/src/Model/StyleModel.php @@ -65,13 +65,13 @@ class StyleModel extends AdminModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { $config = array_merge( [ diff --git a/administrator/components/com_templates/src/Model/StylesModel.php b/administrator/components/com_templates/src/Model/StylesModel.php index 9073547198cca..f1e7039d65fda 100644 --- a/administrator/components/com_templates/src/Model/StylesModel.php +++ b/administrator/components/com_templates/src/Model/StylesModel.php @@ -31,13 +31,13 @@ class StylesModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_templates/src/Model/TemplatesModel.php b/administrator/components/com_templates/src/Model/TemplatesModel.php index f801a9a9d4a5b..b54c346f3fd21 100644 --- a/administrator/components/com_templates/src/Model/TemplatesModel.php +++ b/administrator/components/com_templates/src/Model/TemplatesModel.php @@ -32,13 +32,13 @@ class TemplatesModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_templates/src/Table/StyleTable.php b/administrator/components/com_templates/src/Table/StyleTable.php index 1a8c4f4c34294..f4aaccebbec7a 100644 --- a/administrator/components/com_templates/src/Table/StyleTable.php +++ b/administrator/components/com_templates/src/Table/StyleTable.php @@ -36,7 +36,7 @@ class StyleTable extends Table * * @since 1.6 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__template_styles', 'id', $db, $dispatcher); } diff --git a/administrator/components/com_users/src/Controller/CallbackController.php b/administrator/components/com_users/src/Controller/CallbackController.php index 6b7a44fac411d..e58524965240e 100644 --- a/administrator/components/com_users/src/Controller/CallbackController.php +++ b/administrator/components/com_users/src/Controller/CallbackController.php @@ -32,14 +32,14 @@ class CallbackController extends BaseController /** * Public constructor * - * @param array $config Plugin configuration - * @param MVCFactoryInterface|null $factory MVC Factory for the com_users component - * @param CMSApplication|null $app CMS application object - * @param Input|null $input Joomla CMS input object + * @param array $config Plugin configuration + * @param ?MVCFactoryInterface $factory MVC Factory for the com_users component + * @param ?CMSApplication $app CMS application object + * @param ?Input $input Joomla CMS input object * * @since 4.2.0 */ - public function __construct(array $config = [], MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null) + public function __construct(array $config = [], ?MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_users/src/Controller/CaptiveController.php b/administrator/components/com_users/src/Controller/CaptiveController.php index 392cfb730e3d4..c457c4ac2db55 100644 --- a/administrator/components/com_users/src/Controller/CaptiveController.php +++ b/administrator/components/com_users/src/Controller/CaptiveController.php @@ -41,14 +41,14 @@ class CaptiveController extends BaseController implements UserFactoryAwareInterf /** * Public constructor * - * @param array $config Plugin configuration - * @param MVCFactoryInterface|null $factory MVC Factory for the com_users component - * @param CMSApplication|null $app CMS application object - * @param Input|null $input Joomla CMS input object + * @param array $config Plugin configuration + * @param ?MVCFactoryInterface $factory MVC Factory for the com_users component + * @param ?CMSApplication $app CMS application object + * @param ?Input $input Joomla CMS input object * * @since 4.2.0 */ - public function __construct(array $config = [], MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null) + public function __construct(array $config = [], ?MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_users/src/Controller/MethodController.php b/administrator/components/com_users/src/Controller/MethodController.php index 684a8b5483385..2816d28535fab 100644 --- a/administrator/components/com_users/src/Controller/MethodController.php +++ b/administrator/components/com_users/src/Controller/MethodController.php @@ -44,14 +44,14 @@ class MethodController extends BaseControllerAlias implements UserFactoryAwareIn /** * Public constructor * - * @param array $config Plugin configuration - * @param MVCFactoryInterface|null $factory MVC Factory for the com_users component - * @param CMSApplication|null $app CMS application object - * @param Input|null $input Joomla CMS input object + * @param array $config Plugin configuration + * @param ?MVCFactoryInterface $factory MVC Factory for the com_users component + * @param ?CMSApplication $app CMS application object + * @param ?Input $input Joomla CMS input object * * @since 4.2.0 */ - public function __construct(array $config = [], MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null) + public function __construct(array $config = [], ?MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null) { // We have to tell Joomla what is the name of the view, otherwise it defaults to the name of the *component*. $config['default_view'] = 'method'; diff --git a/administrator/components/com_users/src/Controller/MethodsController.php b/administrator/components/com_users/src/Controller/MethodsController.php index 4c13aba3c9bd4..bd0c655a18a99 100644 --- a/administrator/components/com_users/src/Controller/MethodsController.php +++ b/administrator/components/com_users/src/Controller/MethodsController.php @@ -39,14 +39,14 @@ class MethodsController extends BaseController implements UserFactoryAwareInterf /** * Public constructor * - * @param array $config Plugin configuration - * @param MVCFactoryInterface|null $factory MVC Factory for the com_users component - * @param CMSApplication|null $app CMS application object - * @param Input|null $input Joomla CMS input object + * @param array $config Plugin configuration + * @param ?MVCFactoryInterface $factory MVC Factory for the com_users component + * @param ?CMSApplication $app CMS application object + * @param ?Input $input Joomla CMS input object * * @since 4.2.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null) { // We have to tell Joomla what is the name of the view, otherwise it defaults to the name of the *component*. $config['default_view'] = 'Methods'; diff --git a/administrator/components/com_users/src/Controller/UsersController.php b/administrator/components/com_users/src/Controller/UsersController.php index 04cb09ebd3bc8..9840b5708dd2e 100644 --- a/administrator/components/com_users/src/Controller/UsersController.php +++ b/administrator/components/com_users/src/Controller/UsersController.php @@ -40,15 +40,15 @@ class UsersController extends AdminController * Constructor. * * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The CMSApplication for the dispatcher - * @param Input $input Input + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The CMSApplication for the dispatcher + * @param ?Input $input Input * * @since 1.6 * @see BaseController * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_users/src/Model/BackupcodesModel.php b/administrator/components/com_users/src/Model/BackupcodesModel.php index e24e871b5ac83..5f16e45417570 100644 --- a/administrator/components/com_users/src/Model/BackupcodesModel.php +++ b/administrator/components/com_users/src/Model/BackupcodesModel.php @@ -39,13 +39,13 @@ class BackupcodesModel extends BaseDatabaseModel /** * Get the backup codes record for the specified user * - * @param User|null $user The user in question. Use null for the currently logged in user. + * @param ?User $user The user in question. Use null for the currently logged in user. * - * @return MfaTable|null Record object or null if none is found + * @return ?MfaTable Record object or null if none is found * @throws \Exception * @since 4.2.0 */ - public function getBackupCodesRecord(User $user = null): ?MfaTable + public function getBackupCodesRecord(?User $user = null): ?MfaTable { // Make sure I have a user if (empty($user)) { @@ -72,13 +72,13 @@ public function getBackupCodesRecord(User $user = null): ?MfaTable * Generate a new set of backup codes for the specified user. The generated codes are immediately saved to the * database and the internal cache is updated. * - * @param User|null $user Which user to generate codes for? + * @param ?User $user Which user to generate codes for? * * @return void * @throws \Exception * @since 4.2.0 */ - public function regenerateBackupCodes(User $user = null): void + public function regenerateBackupCodes(?User $user = null): void { // Make sure I have a user if (empty($user)) { @@ -100,8 +100,8 @@ public function regenerateBackupCodes(User $user = null): void /** * Saves the backup codes to the database * - * @param array $codes An array of exactly 10 elements - * @param User|null $user The user for which to save the backup codes + * @param array $codes An array of exactly 10 elements + * @param ?User $user The user for which to save the backup codes * * @return boolean * @throws \Exception @@ -161,13 +161,13 @@ public function saveBackupCodes(array $codes, ?User $user = null): bool * Returns the backup codes for the specified user. Cached values will be preferentially returned, therefore you * MUST go through this model's Methods ONLY when dealing with backup codes. * - * @param User|null $user The user for which you want the backup codes + * @param ?User $user The user for which you want the backup codes * - * @return array|null The backup codes, or null if they do not exist + * @return ?array The backup codes, or null if they do not exist * @throws \Exception * @since 4.2.0 */ - public function getBackupCodes(User $user = null): ?array + public function getBackupCodes(?User $user = null): ?array { // Make sure I have a user if (empty($user)) { @@ -202,8 +202,8 @@ public function getBackupCodes(User $user = null): ?array * Check if the provided string is a backup code. If it is, it will be removed from the list (replaced with an empty * string) and the codes will be saved to the database. All comparisons are performed in a timing safe manner. * - * @param string $code The code to check - * @param User|null $user The user to check against + * @param string $code The code to check + * @param ?User $user The user to check against * * @return boolean * @throws \Exception diff --git a/administrator/components/com_users/src/Model/CaptiveModel.php b/administrator/components/com_users/src/Model/CaptiveModel.php index a9691e25035b2..074abd33bffbe 100644 --- a/administrator/components/com_users/src/Model/CaptiveModel.php +++ b/administrator/components/com_users/src/Model/CaptiveModel.php @@ -53,14 +53,14 @@ class CaptiveModel extends BaseDatabaseModel * Similar code paths are followed by any canonical code which tries to load modules. So even if your template does * not use jdoc tags this code will still work as expected. * - * @param CMSApplication|null $app The CMS application to manipulate + * @param ?CMSApplication $app The CMS application to manipulate * * @return void * @throws \Exception * * @since 4.2.0 */ - public function suppressAllModules(CMSApplication $app = null): void + public function suppressAllModules(?CMSApplication $app = null): void { if (\is_null($app)) { $app = Factory::getApplication(); @@ -72,15 +72,15 @@ public function suppressAllModules(CMSApplication $app = null): void /** * Get the MFA records for the user which correspond to active plugins * - * @param User|null $user The user for which to fetch records. Skip to use the current user. - * @param bool $includeBackupCodes Should I include the backup codes record? + * @param ?User $user The user for which to fetch records. Skip to use the current user. + * @param bool $includeBackupCodes Should I include the backup codes record? * * @return array * @throws \Exception * * @since 4.2.0 */ - public function getRecords(User $user = null, bool $includeBackupCodes = false): array + public function getRecords(?User $user = null, bool $includeBackupCodes = false): array { if (\is_null($user)) { $user = $this->getCurrentUser(); diff --git a/administrator/components/com_users/src/Model/DebuggroupModel.php b/administrator/components/com_users/src/Model/DebuggroupModel.php index 8859a5fead773..1e54d8beabac7 100644 --- a/administrator/components/com_users/src/Model/DebuggroupModel.php +++ b/administrator/components/com_users/src/Model/DebuggroupModel.php @@ -33,13 +33,13 @@ class DebuggroupModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_users/src/Model/DebuguserModel.php b/administrator/components/com_users/src/Model/DebuguserModel.php index bbc3664ea981d..e659e13252f1c 100644 --- a/administrator/components/com_users/src/Model/DebuguserModel.php +++ b/administrator/components/com_users/src/Model/DebuguserModel.php @@ -37,13 +37,13 @@ class DebuguserModel extends ListModel implements UserFactoryAwareInterface /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_users/src/Model/GroupModel.php b/administrator/components/com_users/src/Model/GroupModel.php index 6c90f55193572..ab61f26e976b5 100644 --- a/administrator/components/com_users/src/Model/GroupModel.php +++ b/administrator/components/com_users/src/Model/GroupModel.php @@ -38,13 +38,13 @@ class GroupModel extends AdminModel /** * Override parent constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { $config = array_merge( [ diff --git a/administrator/components/com_users/src/Model/GroupsModel.php b/administrator/components/com_users/src/Model/GroupsModel.php index a724186f98636..6368ba04fd246 100644 --- a/administrator/components/com_users/src/Model/GroupsModel.php +++ b/administrator/components/com_users/src/Model/GroupsModel.php @@ -31,13 +31,13 @@ class GroupsModel extends ListModel /** * Override parent constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_users/src/Model/LevelsModel.php b/administrator/components/com_users/src/Model/LevelsModel.php index e586665311302..6f35720ba0c67 100644 --- a/administrator/components/com_users/src/Model/LevelsModel.php +++ b/administrator/components/com_users/src/Model/LevelsModel.php @@ -33,13 +33,13 @@ class LevelsModel extends ListModel /** * Override parent constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_users/src/Model/MethodModel.php b/administrator/components/com_users/src/Model/MethodModel.php index 5d7bd9909a959..7b2d3ce02c176 100644 --- a/administrator/components/com_users/src/Model/MethodModel.php +++ b/administrator/components/com_users/src/Model/MethodModel.php @@ -119,14 +119,14 @@ public function getRenderOptions(?User $user = null): SetupRenderOptions /** * Get the specified MFA record. It will return a fake default record when no record ID is specified. * - * @param User|null $user The user record. Null to use the currently logged in user. + * @param ?User $user The user record. Null to use the currently logged in user. * * @return MfaTable * @throws \Exception * * @since 4.2.0 */ - public function getRecord(User $user = null): MfaTable + public function getRecord(?User $user = null): MfaTable { if (\is_null($user)) { $user = $this->getCurrentUser(); diff --git a/administrator/components/com_users/src/Model/NotesModel.php b/administrator/components/com_users/src/Model/NotesModel.php index 252fda8478212..f7b3d816ea969 100644 --- a/administrator/components/com_users/src/Model/NotesModel.php +++ b/administrator/components/com_users/src/Model/NotesModel.php @@ -31,13 +31,13 @@ class NotesModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { // Set the list ordering fields. if (empty($config['filter_fields'])) { diff --git a/administrator/components/com_users/src/Model/UserModel.php b/administrator/components/com_users/src/Model/UserModel.php index cdbbd8ed9baef..9e2f9d58f66dc 100644 --- a/administrator/components/com_users/src/Model/UserModel.php +++ b/administrator/components/com_users/src/Model/UserModel.php @@ -49,13 +49,13 @@ class UserModel extends AdminModel implements UserFactoryAwareInterface /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { $config = array_merge( [ diff --git a/administrator/components/com_users/src/Model/UsersModel.php b/administrator/components/com_users/src/Model/UsersModel.php index b5c7f3ceaac50..64dbb66584da4 100644 --- a/administrator/components/com_users/src/Model/UsersModel.php +++ b/administrator/components/com_users/src/Model/UsersModel.php @@ -43,13 +43,13 @@ class UsersModel extends ListModel /** * Override parent constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/administrator/components/com_users/src/Table/MfaTable.php b/administrator/components/com_users/src/Table/MfaTable.php index dd069d1bad2d4..598d98a977c2c 100644 --- a/administrator/components/com_users/src/Table/MfaTable.php +++ b/administrator/components/com_users/src/Table/MfaTable.php @@ -84,7 +84,7 @@ class MfaTable extends Table implements CurrentUserInterface, UserFactoryAwareIn * * @since 4.2.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__user_mfa', 'id', $db, $dispatcher); diff --git a/administrator/components/com_users/src/Table/NoteTable.php b/administrator/components/com_users/src/Table/NoteTable.php index 8a6c393a99a42..3ff60fa8c69f7 100644 --- a/administrator/components/com_users/src/Table/NoteTable.php +++ b/administrator/components/com_users/src/Table/NoteTable.php @@ -47,7 +47,7 @@ class NoteTable extends Table implements VersionableTableInterface, CurrentUserI * * @since 2.5 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { $this->typeAlias = 'com_users.note'; parent::__construct('#__user_notes', 'id', $db, $dispatcher); diff --git a/administrator/components/com_workflow/src/Controller/DisplayController.php b/administrator/components/com_workflow/src/Controller/DisplayController.php index 69901710696e7..d78369db70b8d 100644 --- a/administrator/components/com_workflow/src/Controller/DisplayController.php +++ b/administrator/components/com_workflow/src/Controller/DisplayController.php @@ -56,15 +56,15 @@ class DisplayController extends BaseController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 4.0.0 * @throws \InvalidArgumentException when no extension is set */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_workflow/src/Controller/StageController.php b/administrator/components/com_workflow/src/Controller/StageController.php index 000801b958692..b113d32619212 100644 --- a/administrator/components/com_workflow/src/Controller/StageController.php +++ b/administrator/components/com_workflow/src/Controller/StageController.php @@ -54,15 +54,15 @@ class StageController extends FormController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 4.0.0 * @throws \InvalidArgumentException when no extension or workflow id is set */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_workflow/src/Controller/StagesController.php b/administrator/components/com_workflow/src/Controller/StagesController.php index 4f82b57d433a5..bd5c25f62b935 100644 --- a/administrator/components/com_workflow/src/Controller/StagesController.php +++ b/administrator/components/com_workflow/src/Controller/StagesController.php @@ -64,15 +64,15 @@ class StagesController extends AdminController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 4.0.0 * @throws \InvalidArgumentException when no extension or workflow id is set */ - public function __construct(array $config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct(array $config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_workflow/src/Controller/TransitionController.php b/administrator/components/com_workflow/src/Controller/TransitionController.php index 95d5c69c7849a..e78227550dab3 100644 --- a/administrator/components/com_workflow/src/Controller/TransitionController.php +++ b/administrator/components/com_workflow/src/Controller/TransitionController.php @@ -54,15 +54,15 @@ class TransitionController extends FormController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 4.0.0 * @throws \InvalidArgumentException when no extension or workflow id is set */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_workflow/src/Controller/TransitionsController.php b/administrator/components/com_workflow/src/Controller/TransitionsController.php index b0b4d0a11c230..823be6773f2aa 100644 --- a/administrator/components/com_workflow/src/Controller/TransitionsController.php +++ b/administrator/components/com_workflow/src/Controller/TransitionsController.php @@ -62,15 +62,15 @@ class TransitionsController extends AdminController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 4.0.0 * @throws \InvalidArgumentException when no extension or workflow id is set */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_workflow/src/Controller/WorkflowController.php b/administrator/components/com_workflow/src/Controller/WorkflowController.php index 85a365fbddd37..077e43c0445ae 100644 --- a/administrator/components/com_workflow/src/Controller/WorkflowController.php +++ b/administrator/components/com_workflow/src/Controller/WorkflowController.php @@ -48,15 +48,15 @@ class WorkflowController extends FormController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 4.0.0 * @throws \InvalidArgumentException when no extension is set */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_workflow/src/Controller/WorkflowsController.php b/administrator/components/com_workflow/src/Controller/WorkflowsController.php index 9291a5945afd8..3d4f59877b21f 100644 --- a/administrator/components/com_workflow/src/Controller/WorkflowsController.php +++ b/administrator/components/com_workflow/src/Controller/WorkflowsController.php @@ -48,15 +48,15 @@ class WorkflowsController extends AdminController /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. - * @param CMSApplication $app The Application for the dispatcher - * @param Input $input Input + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input * * @since 4.0.0 * @throws \InvalidArgumentException when no extension is set */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_workflow/src/Table/StageTable.php b/administrator/components/com_workflow/src/Table/StageTable.php index cb289536f9c9b..65ad2a1a27aac 100644 --- a/administrator/components/com_workflow/src/Table/StageTable.php +++ b/administrator/components/com_workflow/src/Table/StageTable.php @@ -45,7 +45,7 @@ class StageTable extends Table * * @since 4.0.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__workflow_stages', 'id', $db, $dispatcher); } @@ -250,14 +250,14 @@ protected function _getAssetTitle() /** * Get the parent asset id for the record * - * @param Table|null $table A Table object for the asset parent. - * @param integer|null $id The id for the asset + * @param ?Table $table A Table object for the asset parent. + * @param ?integer $id The id for the asset * * @return integer The id of the asset's parent * * @since 4.0.0 */ - protected function _getAssetParentId(Table $table = null, $id = null) + protected function _getAssetParentId(?Table $table = null, $id = null) { $asset = new Asset($this->getDbo(), $this->getDispatcher()); diff --git a/administrator/components/com_workflow/src/Table/TransitionTable.php b/administrator/components/com_workflow/src/Table/TransitionTable.php index 99ce16d800f1d..d8a9048f380f0 100644 --- a/administrator/components/com_workflow/src/Table/TransitionTable.php +++ b/administrator/components/com_workflow/src/Table/TransitionTable.php @@ -53,7 +53,7 @@ class TransitionTable extends Table * * @since 4.0.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__workflow_transitions', 'id', $db, $dispatcher); } @@ -119,14 +119,14 @@ protected function _getAssetTitle() /** * Get the parent asset id for the record * - * @param Table $table A Table object for the asset parent. - * @param integer $id The id for the asset + * @param ?Table $table A Table object for the asset parent. + * @param ?integer $id The id for the asset * * @return integer The id of the asset's parent * * @since 4.0.0 */ - protected function _getAssetParentId(Table $table = null, $id = null) + protected function _getAssetParentId(?Table $table = null, $id = null) { $asset = new Asset($this->getDbo(), $this->getDispatcher()); diff --git a/administrator/components/com_workflow/src/Table/WorkflowTable.php b/administrator/components/com_workflow/src/Table/WorkflowTable.php index ce6718394c3e5..7422ae4d24a66 100644 --- a/administrator/components/com_workflow/src/Table/WorkflowTable.php +++ b/administrator/components/com_workflow/src/Table/WorkflowTable.php @@ -48,7 +48,7 @@ class WorkflowTable extends Table implements CurrentUserInterface * * @since 4.0.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { $this->typeAlias = '{extension}.workflow'; @@ -284,14 +284,14 @@ protected function _getAssetTitle() /** * Get the parent asset id for the record * - * @param Table $table A Table object for the asset parent. - * @param integer $id The id for the asset + * @param ?Table $table A Table object for the asset parent. + * @param ?integer $id The id for the asset * * @return integer The id of the asset's parent * * @since 4.0.0 */ - protected function _getAssetParentId(Table $table = null, $id = null) + protected function _getAssetParentId(?Table $table = null, $id = null) { $assetId = null; diff --git a/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php b/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php index 69d1fc7c06fb2..ad63848b5c6bd 100644 --- a/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php +++ b/administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php @@ -50,7 +50,7 @@ class QuickIconHelper * * @since 1.6 */ - public function getButtons(Registry $params, CMSApplication $application = null) + public function getButtons(Registry $params, ?CMSApplication $application = null) { if ($application == null) { $application = Factory::getApplication(); From 1740af6b25dd5dccffbca6f8908cad336b87f47d Mon Sep 17 00:00:00 2001 From: Christian Heel <66922325+heelc29@users.noreply.github.com> Date: Sat, 20 Apr 2024 19:37:42 +0200 Subject: [PATCH 3/9] api --- .../com_categories/src/View/Categories/JsonapiView.php | 4 ++-- .../com_config/src/View/Application/JsonapiView.php | 4 ++-- api/components/com_config/src/View/Component/JsonapiView.php | 4 ++-- api/components/com_contact/src/View/Contacts/JsonapiView.php | 4 ++-- api/components/com_content/src/View/Articles/JsonapiView.php | 4 ++-- .../com_languages/src/View/Overrides/JsonapiView.php | 4 ++-- api/components/com_languages/src/View/Strings/JsonapiView.php | 4 ++-- api/components/com_users/src/View/Users/JsonapiView.php | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/api/components/com_categories/src/View/Categories/JsonapiView.php b/api/components/com_categories/src/View/Categories/JsonapiView.php index 360a5ba3f03a2..c1017c9318b33 100644 --- a/api/components/com_categories/src/View/Categories/JsonapiView.php +++ b/api/components/com_categories/src/View/Categories/JsonapiView.php @@ -97,13 +97,13 @@ class JsonapiView extends BaseApiView /** * Execute and display a template script. * - * @param array|null $items Array of items + * @param ?array $items Array of items * * @return string * * @since 4.0.0 */ - public function displayList(array $items = null) + public function displayList(?array $items = null) { foreach (FieldsHelper::getFields('com_content.categories') as $field) { $this->fieldsToRenderList[] = $field->name; diff --git a/api/components/com_config/src/View/Application/JsonapiView.php b/api/components/com_config/src/View/Application/JsonapiView.php index f989ab4238762..f8622e66b73fd 100644 --- a/api/components/com_config/src/View/Application/JsonapiView.php +++ b/api/components/com_config/src/View/Application/JsonapiView.php @@ -31,13 +31,13 @@ class JsonapiView extends BaseApiView /** * Execute and display a template script. * - * @param array|null $items Array of items + * @param ?array $items Array of items * * @return string * * @since 4.0.0 */ - public function displayList(array $items = null) + public function displayList(?array $items = null) { /** @var ApplicationModel $model */ $model = $this->getModel(); diff --git a/api/components/com_config/src/View/Component/JsonapiView.php b/api/components/com_config/src/View/Component/JsonapiView.php index 74e0b04ca21aa..82625f27a5670 100644 --- a/api/components/com_config/src/View/Component/JsonapiView.php +++ b/api/components/com_config/src/View/Component/JsonapiView.php @@ -32,13 +32,13 @@ class JsonapiView extends BaseApiView /** * Execute and display a template script. * - * @param array|null $items Array of items + * @param ?array $items Array of items * * @return string * * @since 4.0.0 */ - public function displayList(array $items = null) + public function displayList(?array $items = null) { try { $component = ComponentHelper::getComponent($this->get('component_name')); diff --git a/api/components/com_contact/src/View/Contacts/JsonapiView.php b/api/components/com_contact/src/View/Contacts/JsonapiView.php index 59d66eaaa8063..4036a77638264 100644 --- a/api/components/com_contact/src/View/Contacts/JsonapiView.php +++ b/api/components/com_contact/src/View/Contacts/JsonapiView.php @@ -128,13 +128,13 @@ public function __construct($config = []) /** * Execute and display a template script. * - * @param array|null $items Array of items + * @param ?array $items Array of items * * @return string * * @since 4.0.0 */ - public function displayList(array $items = null) + public function displayList(?array $items = null) { foreach (FieldsHelper::getFields('com_contact.contact') as $field) { $this->fieldsToRenderList[] = $field->name; diff --git a/api/components/com_content/src/View/Articles/JsonapiView.php b/api/components/com_content/src/View/Articles/JsonapiView.php index 9e8e2e06cdc34..57274e0b6bac7 100644 --- a/api/components/com_content/src/View/Articles/JsonapiView.php +++ b/api/components/com_content/src/View/Articles/JsonapiView.php @@ -138,13 +138,13 @@ public function __construct($config = []) /** * Execute and display a template script. * - * @param array|null $items Array of items + * @param ?array $items Array of items * * @return string * * @since 4.0.0 */ - public function displayList(array $items = null) + public function displayList(?array $items = null) { foreach (FieldsHelper::getFields('com_content.article') as $field) { $this->fieldsToRenderList[] = $field->name; diff --git a/api/components/com_languages/src/View/Overrides/JsonapiView.php b/api/components/com_languages/src/View/Overrides/JsonapiView.php index 032611383714d..8d5ab5ee72322 100644 --- a/api/components/com_languages/src/View/Overrides/JsonapiView.php +++ b/api/components/com_languages/src/View/Overrides/JsonapiView.php @@ -60,13 +60,13 @@ public function displayItem($item = null) /** * Execute and display a template script. * - * @param array|null $items Array of items + * @param ?array $items Array of items * * @return string * * @since 4.0.0 */ - public function displayList(array $items = null) + public function displayList(?array $items = null) { /** @var \Joomla\Component\Languages\Administrator\Model\OverridesModel $model */ $model = $this->getModel(); diff --git a/api/components/com_languages/src/View/Strings/JsonapiView.php b/api/components/com_languages/src/View/Strings/JsonapiView.php index e0302321d37ae..b237480771c0d 100644 --- a/api/components/com_languages/src/View/Strings/JsonapiView.php +++ b/api/components/com_languages/src/View/Strings/JsonapiView.php @@ -42,13 +42,13 @@ class JsonapiView extends BaseApiView /** * Execute and display a template script. * - * @param array|null $items Array of items + * @param ?array $items Array of items * * @return string * * @since 4.0.0 */ - public function displayList(array $items = null) + public function displayList(?array $items = null) { /** @var \Joomla\Component\Languages\Administrator\Model\StringsModel $model */ $model = $this->getModel(); diff --git a/api/components/com_users/src/View/Users/JsonapiView.php b/api/components/com_users/src/View/Users/JsonapiView.php index a1e5a91f10cd4..64bf5e825615a 100644 --- a/api/components/com_users/src/View/Users/JsonapiView.php +++ b/api/components/com_users/src/View/Users/JsonapiView.php @@ -69,13 +69,13 @@ class JsonapiView extends BaseApiView /** * Execute and display a template script. * - * @param array|null $items Array of items + * @param ?array $items Array of items * * @return string * * @since 4.0.0 */ - public function displayList(array $items = null) + public function displayList(?array $items = null) { foreach (FieldsHelper::getFields('com_users.user') as $field) { $this->fieldsToRenderList[] = $field->name; From 38326f2a996158fb8fa7cae597902460a06ca65a Mon Sep 17 00:00:00 2001 From: Christian Heel <66922325+heelc29@users.noreply.github.com> Date: Sat, 20 Apr 2024 19:41:01 +0200 Subject: [PATCH 4/9] components --- .../com_config/src/Controller/ConfigController.php | 14 +++++++------- .../src/Controller/ModulesController.php | 14 +++++++------- .../src/Controller/TemplatesController.php | 14 +++++++------- .../src/Controller/DisplayController.php | 14 +++++++------- .../src/Rule/ContactEmailMessageRule.php | 6 +++--- .../com_contact/src/Rule/ContactEmailRule.php | 6 +++--- .../src/Rule/ContactEmailSubjectRule.php | 6 +++--- .../src/Controller/DisplayController.php | 14 +++++++------- components/com_content/src/Helper/QueryHelper.php | 14 +++++++------- .../src/Controller/DisplayController.php | 10 +++++----- .../src/Controller/DisplayController.php | 14 +++++++------- .../src/Controller/DisplayController.php | 14 +++++++------- .../com_newsfeeds/src/Model/CategoryModel.php | 6 +++--- components/com_tags/src/Model/TagModel.php | 6 +++--- components/com_users/src/Model/ProfileModel.php | 8 ++++---- .../com_users/src/Model/RegistrationModel.php | 8 ++++---- .../com_users/src/Rule/LoginUniqueFieldRule.php | 6 +++--- .../com_users/src/Rule/LogoutUniqueFieldRule.php | 6 +++--- 18 files changed, 90 insertions(+), 90 deletions(-) diff --git a/components/com_config/src/Controller/ConfigController.php b/components/com_config/src/Controller/ConfigController.php index 5866bc0955b44..6f12d73fa24d4 100644 --- a/components/com_config/src/Controller/ConfigController.php +++ b/components/com_config/src/Controller/ConfigController.php @@ -30,16 +30,16 @@ class ConfigController extends BaseController { /** - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface|null $factory The factory. - * @param CMSApplication|null $app The JApplication for the dispatcher - * @param \Joomla\CMS\Input\Input|null $input The Input object for the request + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The JApplication for the dispatcher + * @param ?\Joomla\CMS\Input\Input $input The Input object for the request * * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/components/com_config/src/Controller/ModulesController.php b/components/com_config/src/Controller/ModulesController.php index a95507c9d86ed..07ad8d6a60d79 100644 --- a/components/com_config/src/Controller/ModulesController.php +++ b/components/com_config/src/Controller/ModulesController.php @@ -34,16 +34,16 @@ class ModulesController extends BaseController { /** - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface|null $factory The factory. - * @param CMSApplication|null $app The Application for the dispatcher - * @param \Joomla\CMS\Input\Input|null $input The Input object for the request + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?\Joomla\CMS\Input\Input $input The Input object for the request * * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/components/com_config/src/Controller/TemplatesController.php b/components/com_config/src/Controller/TemplatesController.php index e4b54296263ab..dd27c137537db 100644 --- a/components/com_config/src/Controller/TemplatesController.php +++ b/components/com_config/src/Controller/TemplatesController.php @@ -30,16 +30,16 @@ class TemplatesController extends BaseController { /** - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface|null $factory The factory. - * @param CMSApplication|null $app The Application for the dispatcher - * @param \Joomla\CMS\Input\Input|null $input The Input object for the request + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?\Joomla\CMS\Input\Input $input The Input object for the request * * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/components/com_contact/src/Controller/DisplayController.php b/components/com_contact/src/Controller/DisplayController.php index 74fce34b4da98..3783831cb5b9c 100644 --- a/components/com_contact/src/Controller/DisplayController.php +++ b/components/com_contact/src/Controller/DisplayController.php @@ -27,16 +27,16 @@ class DisplayController extends BaseController { /** - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface|null $factory The factory. - * @param CMSApplication|null $app The Application for the dispatcher - * @param \Joomla\CMS\Input\Input|null $input The Input object for the request + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?\Joomla\CMS\Input\Input $input The Input object for the request * * @since 3.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { // Contact frontpage Editor contacts proxying. $input = Factory::getApplication()->getInput(); diff --git a/components/com_contact/src/Rule/ContactEmailMessageRule.php b/components/com_contact/src/Rule/ContactEmailMessageRule.php index 956200d2bd104..ed553b138b5dc 100644 --- a/components/com_contact/src/Rule/ContactEmailMessageRule.php +++ b/components/com_contact/src/Rule/ContactEmailMessageRule.php @@ -35,12 +35,12 @@ class ContactEmailMessageRule extends FormRule * @param string $group The field name group control value. This acts as an array container for the field. * For example if the field has name="foo" and the group value is set to "bar" then the * full field name would end up being "bar[foo]". - * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. - * @param Form $form The form object for which the field is being tested. + * @param ?Registry $input An optional Registry object with the entire data set to validate against the entire form. + * @param ?Form $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $params = ComponentHelper::getParams('com_contact'); $banned = $params->get('banned_text'); diff --git a/components/com_contact/src/Rule/ContactEmailRule.php b/components/com_contact/src/Rule/ContactEmailRule.php index c79ce54046d01..1f2f906c8dab2 100644 --- a/components/com_contact/src/Rule/ContactEmailRule.php +++ b/components/com_contact/src/Rule/ContactEmailRule.php @@ -35,12 +35,12 @@ class ContactEmailRule extends EmailRule * @param string $group The field name group control value. This acts as an array container for the field. * For example if the field has name="foo" and the group value is set to "bar" then the * full field name would end up being "bar[foo]". - * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. - * @param Form $form The form object for which the field is being tested. + * @param ?Registry $input An optional Registry object with the entire data set to validate against the entire form. + * @param ?Form $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { if (!parent::test($element, $value, $group, $input, $form)) { return false; diff --git a/components/com_contact/src/Rule/ContactEmailSubjectRule.php b/components/com_contact/src/Rule/ContactEmailSubjectRule.php index 02be40b8c4d49..05426ac9e0eab 100644 --- a/components/com_contact/src/Rule/ContactEmailSubjectRule.php +++ b/components/com_contact/src/Rule/ContactEmailSubjectRule.php @@ -35,12 +35,12 @@ class ContactEmailSubjectRule extends FormRule * @param string $group The field name group control value. This acts as an array container for the field. * For example if the field has name="foo" and the group value is set to "bar" then the * full field name would end up being "bar[foo]". - * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. - * @param Form $form The form object for which the field is being tested. + * @param ?Registry $input An optional Registry object with the entire data set to validate against the entire form. + * @param ?Form $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $params = ComponentHelper::getParams('com_contact'); $banned = $params->get('banned_subject'); diff --git a/components/com_content/src/Controller/DisplayController.php b/components/com_content/src/Controller/DisplayController.php index 20ede3f6f5510..d2d74b9a75087 100644 --- a/components/com_content/src/Controller/DisplayController.php +++ b/components/com_content/src/Controller/DisplayController.php @@ -28,16 +28,16 @@ class DisplayController extends \Joomla\CMS\MVC\Controller\BaseController { /** - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface|null $factory The factory. - * @param CMSApplication|null $app The Application for the dispatcher - * @param \Joomla\CMS\Input\Input|null $input The Input object for the request + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?\Joomla\CMS\Input\Input $input The Input object for the request * * @since 3.0.1 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { $this->input = Factory::getApplication()->getInput(); diff --git a/components/com_content/src/Helper/QueryHelper.php b/components/com_content/src/Helper/QueryHelper.php index aa476d7e5d89b..047ca06d635bb 100644 --- a/components/com_content/src/Helper/QueryHelper.php +++ b/components/com_content/src/Helper/QueryHelper.php @@ -61,15 +61,15 @@ public static function orderbyPrimary($orderby) /** * Translate an order code to a field for article ordering. * - * @param string $orderby The ordering code. - * @param string $orderDate The ordering code for the date. - * @param DatabaseInterface $db The database + * @param string $orderby The ordering code. + * @param string $orderDate The ordering code for the date. + * @param ?DatabaseInterface $db The database * * @return string The SQL field(s) to order by. * * @since 1.5 */ - public static function orderbySecondary($orderby, $orderDate = 'created', DatabaseInterface $db = null) + public static function orderbySecondary($orderby, $orderDate = 'created', ?DatabaseInterface $db = null) { $db = $db ?: Factory::getDbo(); @@ -163,14 +163,14 @@ public static function orderbySecondary($orderby, $orderDate = 'created', Databa /** * Translate an order code to a field for date ordering. * - * @param string $orderDate The ordering code. - * @param DatabaseInterface $db The database + * @param string $orderDate The ordering code. + * @param ?DatabaseInterface $db The database * * @return string The SQL field(s) to order by. * * @since 1.6 */ - public static function getQueryDate($orderDate, DatabaseInterface $db = null) + public static function getQueryDate($orderDate, ?DatabaseInterface $db = null) { $db = $db ?: Factory::getDbo(); diff --git a/components/com_contenthistory/src/Controller/DisplayController.php b/components/com_contenthistory/src/Controller/DisplayController.php index bffb0d31e856d..7e03191127121 100644 --- a/components/com_contenthistory/src/Controller/DisplayController.php +++ b/components/com_contenthistory/src/Controller/DisplayController.php @@ -27,14 +27,14 @@ class DisplayController extends BaseController { /** - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface|null $factory The factory. - * @param CMSApplication|null $app The Application for the dispatcher - * @param ?Input $input The Input object for the request + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input The Input object for the request * * @since 3.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; diff --git a/components/com_fields/src/Controller/DisplayController.php b/components/com_fields/src/Controller/DisplayController.php index 99bc0c0a2b217..74a55c4116d1b 100644 --- a/components/com_fields/src/Controller/DisplayController.php +++ b/components/com_fields/src/Controller/DisplayController.php @@ -25,16 +25,16 @@ class DisplayController extends \Joomla\CMS\MVC\Controller\BaseController { /** - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface|null $factory The factory. - * @param CMSApplication|null $app The Application for the dispatcher - * @param \Joomla\CMS\Input\Input|null $input The request's input object + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?\Joomla\CMS\Input\Input $input The request's input object * * @since 3.7.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { // Frontpage Editor Fields Button proxying. if ($input->get('view') === 'fields' && $input->get('layout') === 'modal') { diff --git a/components/com_modules/src/Controller/DisplayController.php b/components/com_modules/src/Controller/DisplayController.php index 7123321240811..dc76c599ac657 100644 --- a/components/com_modules/src/Controller/DisplayController.php +++ b/components/com_modules/src/Controller/DisplayController.php @@ -28,16 +28,16 @@ class DisplayController extends BaseController { /** - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface|null $factory The factory. - * @param CMSApplication|null $app The Application for the dispatcher - * @param Input|null $input The Input object for the request + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input The Input object for the request * * @since 3.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { $this->input = Factory::getApplication()->getInput(); diff --git a/components/com_newsfeeds/src/Model/CategoryModel.php b/components/com_newsfeeds/src/Model/CategoryModel.php index c979ee6958f46..7a9ae02f8e7c8 100644 --- a/components/com_newsfeeds/src/Model/CategoryModel.php +++ b/components/com_newsfeeds/src/Model/CategoryModel.php @@ -84,13 +84,13 @@ class CategoryModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/components/com_tags/src/Model/TagModel.php b/components/com_tags/src/Model/TagModel.php index 684500cdc98cc..d787559ccd730 100644 --- a/components/com_tags/src/Model/TagModel.php +++ b/components/com_tags/src/Model/TagModel.php @@ -51,12 +51,12 @@ class TagModel extends ListModel /** * Constructor. * - * @param array $config An optional associative array of configuration settings. - * @param MVCFactoryInterface $factory The factory. + * @param array $config An optional associative array of configuration settings. + * @param ?MVCFactoryInterface $factory The factory. * * @since 1.6 */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ diff --git a/components/com_users/src/Model/ProfileModel.php b/components/com_users/src/Model/ProfileModel.php index 2746417a7a858..991400d77a6ad 100644 --- a/components/com_users/src/Model/ProfileModel.php +++ b/components/com_users/src/Model/ProfileModel.php @@ -45,14 +45,14 @@ class ProfileModel extends FormModel /** * Constructor. * - * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). - * @param MVCFactoryInterface $factory The factory. - * @param FormFactoryInterface $formFactory The form factory. + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?FormFactoryInterface $formFactory The form factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, FormFactoryInterface $formFactory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?FormFactoryInterface $formFactory = null) { $config = array_merge( [ diff --git a/components/com_users/src/Model/RegistrationModel.php b/components/com_users/src/Model/RegistrationModel.php index 673553fe6a916..d8ba8bf0fdbc2 100644 --- a/components/com_users/src/Model/RegistrationModel.php +++ b/components/com_users/src/Model/RegistrationModel.php @@ -54,14 +54,14 @@ class RegistrationModel extends FormModel implements UserFactoryAwareInterface /** * Constructor. * - * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). - * @param MVCFactoryInterface $factory The factory. - * @param FormFactoryInterface $formFactory The form factory. + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?FormFactoryInterface $formFactory The form factory. * * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, FormFactoryInterface $formFactory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?FormFactoryInterface $formFactory = null) { $config = array_merge( [ diff --git a/components/com_users/src/Rule/LoginUniqueFieldRule.php b/components/com_users/src/Rule/LoginUniqueFieldRule.php index 44891f7084820..6a8227c146d27 100644 --- a/components/com_users/src/Rule/LoginUniqueFieldRule.php +++ b/components/com_users/src/Rule/LoginUniqueFieldRule.php @@ -36,14 +36,14 @@ class LoginUniqueFieldRule extends FormRule * @param string $group The field name group control value. This acts as an array container for the field. * For example if the field has name="foo" and the group value is set to "bar" then the * full field name would end up being "bar[foo]". - * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. - * @param Form $form The form object for which the field is being tested. + * @param ?Registry $input An optional Registry object with the entire data set to validate against the entire form. + * @param ?Form $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @since 3.6 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $loginRedirectUrl = $input['params']->login_redirect_url; $loginRedirectMenuitem = $input['params']->login_redirect_menuitem; diff --git a/components/com_users/src/Rule/LogoutUniqueFieldRule.php b/components/com_users/src/Rule/LogoutUniqueFieldRule.php index e387311426344..299de562a4dea 100644 --- a/components/com_users/src/Rule/LogoutUniqueFieldRule.php +++ b/components/com_users/src/Rule/LogoutUniqueFieldRule.php @@ -36,14 +36,14 @@ class LogoutUniqueFieldRule extends FormRule * @param string $group The field name group control value. This acts as an array container for the field. * For example if the field has name="foo" and the group value is set to "bar" then the * full field name would end up being "bar[foo]". - * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. - * @param Form $form The form object for which the field is being tested. + * @param ?Registry $input An optional Registry object with the entire data set to validate against the entire form. + * @param ?Form $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @since 3.6 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $logoutRedirectUrl = $input['params']->logout_redirect_url; $logoutRedirectMenuitem = $input['params']->logout_redirect_menuitem; From 29894ef94bb5d3701a9fbc1f77b1fa49ee53fad4 Mon Sep 17 00:00:00 2001 From: Christian Heel <66922325+heelc29@users.noreply.github.com> Date: Sat, 20 Apr 2024 19:49:46 +0200 Subject: [PATCH 5/9] installation --- .../CliInstallationApplication.php | 4 +-- .../Application/InstallationApplication.php | 30 +++++++++---------- .../src/Controller/InstallationController.php | 14 ++++----- installation/src/Form/Rule/UsernameRule.php | 8 ++--- .../src/Model/BaseInstallationModel.php | 6 ++-- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/installation/src/Application/CliInstallationApplication.php b/installation/src/Application/CliInstallationApplication.php index 2d6ba4e7abb48..56f704874f473 100644 --- a/installation/src/Application/CliInstallationApplication.php +++ b/installation/src/Application/CliInstallationApplication.php @@ -213,13 +213,13 @@ public function getLocalise() /** * Returns the installed language files in the administrative and frontend area. * - * @param DatabaseInterface|null $db Database driver. + * @param ?DatabaseInterface $db Database driver. * * @return array Array with installed language packs in admin and site area. * * @since 4.3.0 */ - public function getLocaliseAdmin(DatabaseInterface $db = null) + public function getLocaliseAdmin(?DatabaseInterface $db = null) { $langfiles = []; diff --git a/installation/src/Application/InstallationApplication.php b/installation/src/Application/InstallationApplication.php index 8385974fe05ab..141c034ce4668 100644 --- a/installation/src/Application/InstallationApplication.php +++ b/installation/src/Application/InstallationApplication.php @@ -46,20 +46,20 @@ final class InstallationApplication extends CMSApplication /** * Class constructor. * - * @param Input|null $input An optional argument to provide dependency injection for the application's input - * object. If the argument is a JInput object that object will become the - * application's input object, otherwise a default input object is created. - * @param Registry|null $config An optional argument to provide dependency injection for the application's - * config object. If the argument is a Registry object that object will become - * the application's config object, otherwise a default config object is created. - * @param WebClient|null $client An optional argument to provide dependency injection for the application's - * client object. If the argument is a WebClient object that object will become the - * application's client object, otherwise a default client object is created. - * @param Container|null $container Dependency injection container. + * @param ?Input $input An optional argument to provide dependency injection for the application's input + * object. If the argument is a JInput object that object will become the + * application's input object, otherwise a default input object is created. + * @param ?Registry $config An optional argument to provide dependency injection for the application's + * config object. If the argument is a Registry object that object will become + * the application's config object, otherwise a default config object is created. + * @param ?WebClient $client An optional argument to provide dependency injection for the application's + * client object. If the argument is a WebClient object that object will become the + * application's client object, otherwise a default client object is created. + * @param ?Container $container Dependency injection container. * * @since 3.1 */ - public function __construct(Input $input = null, Registry $config = null, WebClient $client = null, Container $container = null) + public function __construct(?Input $input = null, ?Registry $config = null, ?WebClient $client = null, ?Container $container = null) { // Register the application name. $this->name = 'installation'; @@ -340,13 +340,13 @@ public function getLocalise() /** * Returns the installed language files in the administrative and frontend area. * - * @param DatabaseInterface|null $db Database driver. + * @param ?DatabaseInterface $db Database driver. * * @return array Array with installed language packs in admin and site area. * * @since 3.1 */ - public function getLocaliseAdmin(DatabaseInterface $db = null) + public function getLocaliseAdmin(?DatabaseInterface $db = null) { $langfiles = []; @@ -471,13 +471,13 @@ protected function initialiseApp($options = []) * but for many applications it will make sense to override this method and create a document, * if required, based on more specific needs. * - * @param Document|null $document An optional document object. If omitted, the factory document is created. + * @param ?Document $document An optional document object. If omitted, the factory document is created. * * @return InstallationApplication This method is chainable. * * @since 3.2 */ - public function loadDocument(Document $document = null) + public function loadDocument(?Document $document = null) { if ($document === null) { $lang = $this->getLanguage(); diff --git a/installation/src/Controller/InstallationController.php b/installation/src/Controller/InstallationController.php index 558f5fe20d34f..9d7da966393ec 100644 --- a/installation/src/Controller/InstallationController.php +++ b/installation/src/Controller/InstallationController.php @@ -27,16 +27,16 @@ class InstallationController extends JSONController { /** - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'default_task', 'model_path', and - * 'view_path' (this list is not meant to be comprehensive). - * @param MVCFactoryInterface|null $factory The factory. - * @param CMSApplication|null $app The Application for the dispatcher - * @param \Joomla\CMS\Input\Input|null $input The Input object. + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?\Joomla\CMS\Input\Input $input The Input object. * * @since 3.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/installation/src/Form/Rule/UsernameRule.php b/installation/src/Form/Rule/UsernameRule.php index b1f9402b860b0..969d638ac9003 100644 --- a/installation/src/Form/Rule/UsernameRule.php +++ b/installation/src/Form/Rule/UsernameRule.php @@ -30,15 +30,15 @@ class UsernameRule extends FormRule * * @param \SimpleXMLElement $element The SimpleXMLElement object representing the tag for the form field object. * @param mixed $value The form field value to validate. - * @param string|null $group The field name group control value. This acts as an array container for the field. + * @param ?string $group The field name group control value. This acts as an array container for the field. * For example if the field has name="foo" and the group value is set to "bar" then the * full field name would end up being "bar[foo]". - * @param Registry|null $input An optional Registry object with the entire data set to validate against the entire form. - * @param Form|null $form The form object for which the field is being tested. + * @param ?Registry $input An optional Registry object with the entire data set to validate against the entire form. + * @param ?Form $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $filterInput = InputFilter::getInstance(); diff --git a/installation/src/Model/BaseInstallationModel.php b/installation/src/Model/BaseInstallationModel.php index d8ec4c2fff949..94a27eb723c33 100644 --- a/installation/src/Model/BaseInstallationModel.php +++ b/installation/src/Model/BaseInstallationModel.php @@ -27,13 +27,13 @@ class BaseInstallationModel extends BaseDatabaseModel /** * Constructor * - * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). - * @param MVCFactoryInterface|null $factory The factory. + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. * * @since 3.0 * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { // @TODO remove me when the base model is db free $config['dbo'] = null; From 8d615d0cc9f06f6d993ad8924e2c845f79a875f2 Mon Sep 17 00:00:00 2001 From: Christian Heel <66922325+heelc29@users.noreply.github.com> Date: Sat, 20 Apr 2024 19:53:37 +0200 Subject: [PATCH 6/9] libraries --- .../Application/AdministratorApplication.php | 2 +- libraries/src/Application/ApiApplication.php | 2 +- libraries/src/Application/BaseApplication.php | 2 +- libraries/src/Application/CLI/CliOutput.php | 2 +- libraries/src/Application/CMSApplication.php | 4 +-- .../Application/CMSApplicationInterface.php | 2 +- libraries/src/Application/CliApplication.php | 12 +++---- .../src/Application/DaemonApplication.php | 2 +- libraries/src/Application/IdentityAware.php | 2 +- libraries/src/Application/SiteApplication.php | 2 +- libraries/src/Application/WebApplication.php | 8 ++--- .../src/Authentication/Authentication.php | 6 ++-- .../CacheControllerFactoryAwareTrait.php | 4 +-- .../src/Captcha/CaptchaProviderInterface.php | 6 ++-- .../Google/HttpBridgePostRequestMethod.php | 4 +-- .../src/Categories/CategoryServiceTrait.php | 8 ++--- .../src/Component/Router/RouterFactory.php | 8 ++--- libraries/src/Date/Date.php | 6 ++-- .../Dispatcher/ComponentDispatcherFactory.php | 4 +-- .../ComponentDispatcherFactoryInterface.php | 4 +-- .../Dispatcher/ModuleDispatcherFactory.php | 4 +-- .../ModuleDispatcherFactoryInterface.php | 4 +-- libraries/src/Document/Document.php | 2 +- libraries/src/Document/PreloadManager.php | 2 +- libraries/src/Editor/Editor.php | 8 ++--- libraries/src/Extension/Module.php | 4 +-- libraries/src/Extension/ModuleInterface.php | 4 +-- libraries/src/Feed/FeedParser.php | 6 ++-- libraries/src/Form/Field/CalendarField.php | 2 +- libraries/src/Form/Field/SubformField.php | 4 +-- libraries/src/Form/Filter/IntarrayFilter.php | 2 +- libraries/src/Form/Filter/RawFilter.php | 2 +- libraries/src/Form/Filter/RulesFilter.php | 2 +- libraries/src/Form/Filter/SafehtmlFilter.php | 2 +- libraries/src/Form/Filter/TelFilter.php | 2 +- libraries/src/Form/Filter/UnsetFilter.php | 2 +- libraries/src/Form/Filter/UrlFilter.php | 2 +- libraries/src/Form/FormFactoryAwareTrait.php | 2 +- libraries/src/Form/FormField.php | 6 ++-- libraries/src/Form/FormFilterInterface.php | 2 +- libraries/src/Form/FormRule.php | 2 +- libraries/src/Form/Rule/CalendarRule.php | 2 +- libraries/src/Form/Rule/CaptchaRule.php | 2 +- libraries/src/Form/Rule/ColorRule.php | 2 +- libraries/src/Form/Rule/CssIdentifierRule.php | 2 +- .../Form/Rule/CssIdentifierSubstringRule.php | 2 +- libraries/src/Form/Rule/EmailRule.php | 2 +- libraries/src/Form/Rule/EqualsRule.php | 2 +- libraries/src/Form/Rule/ExistsRule.php | 2 +- libraries/src/Form/Rule/FilePathRule.php | 2 +- .../src/Form/Rule/FolderPathExistsRule.php | 2 +- libraries/src/Form/Rule/NotequalsRule.php | 2 +- libraries/src/Form/Rule/NumberRule.php | 2 +- libraries/src/Form/Rule/OptionsRule.php | 2 +- libraries/src/Form/Rule/PasswordRule.php | 2 +- libraries/src/Form/Rule/RegexRule.php | 2 +- libraries/src/Form/Rule/RulesRule.php | 2 +- libraries/src/Form/Rule/ShowOnRule.php | 16 ++++----- libraries/src/Form/Rule/SubformRule.php | 2 +- libraries/src/Form/Rule/TelRule.php | 2 +- libraries/src/Form/Rule/TimeRule.php | 2 +- libraries/src/Form/Rule/UrlRule.php | 2 +- libraries/src/Form/Rule/UserIdRule.php | 2 +- libraries/src/Form/Rule/UsernameRule.php | 2 +- libraries/src/HTML/HTMLRegistryAwareTrait.php | 4 +-- libraries/src/Http/Http.php | 8 ++--- libraries/src/Input/Cli.php | 6 ++-- libraries/src/Input/Cookie.php | 6 ++-- libraries/src/Input/Files.php | 8 ++--- libraries/src/Input/Json.php | 6 ++-- .../src/Installer/InstallerExtension.php | 4 +-- libraries/src/Language/LanguageHelper.php | 16 ++++----- libraries/src/Language/Multilanguage.php | 4 +-- .../src/MVC/Controller/AdminController.php | 2 +- .../src/MVC/Controller/ApiController.php | 2 +- .../src/MVC/Controller/BaseController.php | 2 +- .../src/MVC/Controller/FormController.php | 4 +-- libraries/src/MVC/Factory/MVCFactory.php | 6 ++-- libraries/src/MVC/Model/AdminModel.php | 2 +- libraries/src/MVC/Model/BaseDatabaseModel.php | 4 +-- .../src/MVC/Model/DatabaseAwareTrait.php | 2 +- libraries/src/MVC/Model/FormModel.php | 2 +- libraries/src/MVC/Model/ListModel.php | 2 +- libraries/src/MVC/View/JsonApiView.php | 4 +-- .../Mail/Exception/MailDisabledException.php | 10 +++--- libraries/src/Mail/MailTemplate.php | 8 ++--- libraries/src/Pagination/Pagination.php | 12 +++---- libraries/src/Pathway/SitePathway.php | 4 +-- libraries/src/Plugin/PluginHelper.php | 18 +++++----- .../Exception/RouteNotFoundException.php | 8 ++--- libraries/src/Router/SiteRouter.php | 6 ++-- libraries/src/Serializer/JoomlaSerializer.php | 4 +-- libraries/src/Session/Session.php | 14 ++++---- .../src/Session/Storage/JoomlaStorage.php | 4 +-- libraries/src/Table/Asset.php | 2 +- libraries/src/Table/Category.php | 8 ++--- libraries/src/Table/Content.php | 8 ++--- libraries/src/Table/ContentHistory.php | 2 +- libraries/src/Table/ContentType.php | 2 +- libraries/src/Table/CoreContent.php | 2 +- libraries/src/Table/Extension.php | 2 +- libraries/src/Table/Language.php | 8 ++--- libraries/src/Table/Menu.php | 2 +- libraries/src/Table/MenuType.php | 8 ++--- libraries/src/Table/Module.php | 8 ++--- libraries/src/Table/Table.php | 8 ++--- libraries/src/Table/Ucm.php | 2 +- libraries/src/Table/Update.php | 2 +- libraries/src/Table/UpdateSite.php | 2 +- libraries/src/Table/User.php | 2 +- libraries/src/Table/Usergroup.php | 2 +- libraries/src/Table/ViewLevel.php | 2 +- libraries/src/Tag/TagServiceTrait.php | 8 ++--- libraries/src/Toolbar/Toolbar.php | 6 ++-- libraries/src/UCM/UCMBase.php | 20 +++++------ libraries/src/UCM/UCMContent.php | 34 +++++++++---------- libraries/src/UCM/UCMType.php | 8 ++--- .../AssetItem/LangActiveAssetItem.php | 12 +++---- libraries/src/WebAsset/WebAssetItem.php | 12 +++---- libraries/src/WebAsset/WebAssetManager.php | 20 +++++------ libraries/src/WebAsset/WebAssetRegistry.php | 12 +++---- .../src/Workflow/WorkflowPluginTrait.php | 4 +-- 122 files changed, 303 insertions(+), 303 deletions(-) diff --git a/libraries/src/Application/AdministratorApplication.php b/libraries/src/Application/AdministratorApplication.php index 672a206e4416c..57b41be3c4830 100644 --- a/libraries/src/Application/AdministratorApplication.php +++ b/libraries/src/Application/AdministratorApplication.php @@ -71,7 +71,7 @@ class AdministratorApplication extends CMSApplication * * @since 3.2 */ - public function __construct(Input $input = null, Registry $config = null, WebClient $client = null, Container $container = null) + public function __construct(?Input $input = null, ?Registry $config = null, ?WebClient $client = null, ?Container $container = null) { // Register the application name $this->name = 'administrator'; diff --git a/libraries/src/Application/ApiApplication.php b/libraries/src/Application/ApiApplication.php index 18061a720f118..188f8509dfb26 100644 --- a/libraries/src/Application/ApiApplication.php +++ b/libraries/src/Application/ApiApplication.php @@ -71,7 +71,7 @@ final class ApiApplication extends CMSApplication * * @since 4.0.0 */ - public function __construct(JInputJson $input = null, Registry $config = null, WebClient $client = null, Container $container = null) + public function __construct(?JInputJson $input = null, ?Registry $config = null, ?WebClient $client = null, ?Container $container = null) { // Register the application name $this->name = 'api'; diff --git a/libraries/src/Application/BaseApplication.php b/libraries/src/Application/BaseApplication.php index fd5c8c081da2d..655952c2b3b06 100644 --- a/libraries/src/Application/BaseApplication.php +++ b/libraries/src/Application/BaseApplication.php @@ -45,7 +45,7 @@ abstract class BaseApplication extends AbstractApplication * * @since 3.0.0 */ - public function __construct(Input $input = null, Registry $config = null) + public function __construct(?Input $input = null, ?Registry $config = null) { $this->input = $input instanceof Input ? $input : new Input(); $this->config = $config instanceof Registry ? $config : new Registry(); diff --git a/libraries/src/Application/CLI/CliOutput.php b/libraries/src/Application/CLI/CliOutput.php index a81b2732249f7..f0126c0e0b838 100644 --- a/libraries/src/Application/CLI/CliOutput.php +++ b/libraries/src/Application/CLI/CliOutput.php @@ -40,7 +40,7 @@ abstract class CliOutput * * @since 4.0.0 */ - public function __construct(ProcessorInterface $processor = null) + public function __construct(?ProcessorInterface $processor = null) { $this->setProcessor($processor ?: new Output\Processor\ColorProcessor()); } diff --git a/libraries/src/Application/CMSApplication.php b/libraries/src/Application/CMSApplication.php index 2ea7735bbee92..238a08cc396fd 100644 --- a/libraries/src/Application/CMSApplication.php +++ b/libraries/src/Application/CMSApplication.php @@ -180,7 +180,7 @@ abstract class CMSApplication extends WebApplication implements ContainerAwareIn * * @since 3.2 */ - public function __construct(Input $input = null, Registry $config = null, WebClient $client = null, Container $container = null) + public function __construct(?Input $input = null, ?Registry $config = null, ?WebClient $client = null, ?Container $container = null) { $container = $container ?: new Container(); $this->setContainer($container); @@ -485,7 +485,7 @@ public function getClientId() * Use the application service from the DI container instead * Example: Factory::getContainer()->get($name); */ - public static function getInstance($name = null, $prefix = '\JApplication', Container $container = null) + public static function getInstance($name = null, $prefix = '\JApplication', ?Container $container = null) { if (empty(static::$instances[$name])) { // Create a CmsApplication object. diff --git a/libraries/src/Application/CMSApplicationInterface.php b/libraries/src/Application/CMSApplicationInterface.php index 8de5886c3f127..98ac3f567f870 100644 --- a/libraries/src/Application/CMSApplicationInterface.php +++ b/libraries/src/Application/CMSApplicationInterface.php @@ -183,5 +183,5 @@ public function getName(); * * @since 4.0.0 */ - public function loadIdentity(User $identity = null); + public function loadIdentity(?User $identity = null); } diff --git a/libraries/src/Application/CliApplication.php b/libraries/src/Application/CliApplication.php index 265087a1c0ae7..18f2dc9bda8cb 100644 --- a/libraries/src/Application/CliApplication.php +++ b/libraries/src/Application/CliApplication.php @@ -113,12 +113,12 @@ abstract class CliApplication extends AbstractApplication implements CMSApplicat * @since 1.7.0 */ public function __construct( - Input $input = null, - Registry $config = null, - CliOutput $output = null, - CliInput $cliInput = null, - DispatcherInterface $dispatcher = null, - Container $container = null + ?Input $input = null, + ?Registry $config = null, + ?CliOutput $output = null, + ?CliInput $cliInput = null, + ?DispatcherInterface $dispatcher = null, + ?Container $container = null ) { // Close the application if we are not executed from the command line. if (!\defined('STDOUT') || !\defined('STDIN') || !isset($_SERVER['argv'])) { diff --git a/libraries/src/Application/DaemonApplication.php b/libraries/src/Application/DaemonApplication.php index 017c68dc96f79..ed904ca78a9f6 100644 --- a/libraries/src/Application/DaemonApplication.php +++ b/libraries/src/Application/DaemonApplication.php @@ -116,7 +116,7 @@ abstract class DaemonApplication extends CliApplication * * @since 1.7.0 */ - public function __construct(Cli $input = null, Registry $config = null, DispatcherInterface $dispatcher = null) + public function __construct(?Cli $input = null, ?Registry $config = null, ?DispatcherInterface $dispatcher = null) { // Verify that the process control extension for PHP is available. if (!\defined('SIGHUP')) { diff --git a/libraries/src/Application/IdentityAware.php b/libraries/src/Application/IdentityAware.php index 08c3d829eb7f9..4c6c4dab9f557 100644 --- a/libraries/src/Application/IdentityAware.php +++ b/libraries/src/Application/IdentityAware.php @@ -54,7 +54,7 @@ public function getIdentity() * * @since 4.0.0 */ - public function loadIdentity(User $identity = null) + public function loadIdentity(?User $identity = null) { $this->identity = $identity ?: $this->getUserFactory()->loadUserById(0); diff --git a/libraries/src/Application/SiteApplication.php b/libraries/src/Application/SiteApplication.php index 5450677e9209a..5debe59f0b3b9 100644 --- a/libraries/src/Application/SiteApplication.php +++ b/libraries/src/Application/SiteApplication.php @@ -84,7 +84,7 @@ final class SiteApplication extends CMSApplication * * @since 3.2 */ - public function __construct(Input $input = null, Registry $config = null, WebClient $client = null, Container $container = null) + public function __construct(?Input $input = null, ?Registry $config = null, ?WebClient $client = null, ?Container $container = null) { // Register the application name $this->name = 'site'; diff --git a/libraries/src/Application/WebApplication.php b/libraries/src/Application/WebApplication.php index 968b31d6e3488..701fcc6c4e52a 100644 --- a/libraries/src/Application/WebApplication.php +++ b/libraries/src/Application/WebApplication.php @@ -105,7 +105,7 @@ abstract class WebApplication extends AbstractWebApplication * * @since 1.7.3 */ - public function __construct(Input $input = null, Registry $config = null, WebClient $client = null, ResponseInterface $response = null) + public function __construct(?Input $input = null, ?Registry $config = null, ?WebClient $client = null, ?ResponseInterface $response = null) { // Ensure we have a CMS Input object otherwise the DI for \Joomla\CMS\Session\Storage\JoomlaStorage fails $input = $input ?: new Input(); @@ -298,7 +298,7 @@ public function flushAssets() * * @since 1.7.3 */ - public function loadDocument(Document $document = null) + public function loadDocument(?Document $document = null) { $this->document = $document ?? Factory::getDocument(); @@ -318,7 +318,7 @@ public function loadDocument(Document $document = null) * * @since 1.7.3 */ - public function loadLanguage(Language $language = null) + public function loadLanguage(?Language $language = null) { $this->language = $language ?? Factory::getLanguage(); OutputFilter::setLanguage($this->language); @@ -342,7 +342,7 @@ public function loadLanguage(Language $language = null) * @deprecated 4.3 will be removed in 6.0 * The session should be injected as a service. */ - public function loadSession(Session $session = null) + public function loadSession(?Session $session = null) { $this->getLogger()->warning(__METHOD__ . '() is deprecated. Inject the session as a service instead.', ['category' => 'deprecated']); diff --git a/libraries/src/Authentication/Authentication.php b/libraries/src/Authentication/Authentication.php index c1902b894762f..31b19f03434dc 100644 --- a/libraries/src/Authentication/Authentication.php +++ b/libraries/src/Authentication/Authentication.php @@ -97,12 +97,12 @@ class Authentication /** * Constructor * - * @param string $pluginType The plugin type to run authorisation and authentication on - * @param DispatcherInterface $dispatcher The event dispatcher we're going to use + * @param string $pluginType The plugin type to run authorisation and authentication on + * @param ?DispatcherInterface $dispatcher The event dispatcher we're going to use * * @since 1.7.0 */ - public function __construct(string $pluginType = 'authentication', DispatcherInterface $dispatcher = null) + public function __construct(string $pluginType = 'authentication', ?DispatcherInterface $dispatcher = null) { // Set the dispatcher if (!\is_object($dispatcher)) { diff --git a/libraries/src/Cache/CacheControllerFactoryAwareTrait.php b/libraries/src/Cache/CacheControllerFactoryAwareTrait.php index b7177dc4cdb5a..664e6d22919a7 100644 --- a/libraries/src/Cache/CacheControllerFactoryAwareTrait.php +++ b/libraries/src/Cache/CacheControllerFactoryAwareTrait.php @@ -55,13 +55,13 @@ protected function getCacheControllerFactory(): CacheControllerFactoryInterface /** * Set the cache controller factory to use. * - * @param CacheControllerFactoryInterface $cacheControllerFactory The cache controller factory to use. + * @param ?CacheControllerFactoryInterface $cacheControllerFactory The cache controller factory to use. * * @return void * * @since 4.2.0 */ - public function setCacheControllerFactory(CacheControllerFactoryInterface $cacheControllerFactory = null): void + public function setCacheControllerFactory(?CacheControllerFactoryInterface $cacheControllerFactory = null): void { $this->cacheControllerFactory = $cacheControllerFactory; } diff --git a/libraries/src/Captcha/CaptchaProviderInterface.php b/libraries/src/Captcha/CaptchaProviderInterface.php index 4aa4536f94620..1e7060e07abc3 100644 --- a/libraries/src/Captcha/CaptchaProviderInterface.php +++ b/libraries/src/Captcha/CaptchaProviderInterface.php @@ -43,15 +43,15 @@ public function display(string $name = '', array $attributes = []): string; /** * Calls an HTTP POST function to verify if the user's guess was correct. * - * @param string $code Answer provided by user + * @param ?string $code Answer provided by user * - * @return bool If the answer is correct, false otherwise + * @return bool If the answer is correct, false otherwise * * @since 5.0.0 * * @throws \RuntimeException */ - public function checkAnswer(string $code = null): bool; + public function checkAnswer(?string $code = null): bool; /** * Method to react on the setup of a captcha field. Gives the possibility diff --git a/libraries/src/Captcha/Google/HttpBridgePostRequestMethod.php b/libraries/src/Captcha/Google/HttpBridgePostRequestMethod.php index 77675cf94075d..7b265138afca0 100644 --- a/libraries/src/Captcha/Google/HttpBridgePostRequestMethod.php +++ b/libraries/src/Captcha/Google/HttpBridgePostRequestMethod.php @@ -45,11 +45,11 @@ final class HttpBridgePostRequestMethod implements RequestMethod /** * Class constructor. * - * @param Http|null $http The HTTP adapter + * @param ?Http $http The HTTP adapter * * @since 3.9.0 */ - public function __construct(Http $http = null) + public function __construct(?Http $http = null) { $this->http = $http ?: HttpFactory::getHttp(); } diff --git a/libraries/src/Categories/CategoryServiceTrait.php b/libraries/src/Categories/CategoryServiceTrait.php index b23570ef09c85..f5d377c61608d 100644 --- a/libraries/src/Categories/CategoryServiceTrait.php +++ b/libraries/src/Categories/CategoryServiceTrait.php @@ -100,13 +100,13 @@ public function prepareForm(Form $form, $data) /** * Returns the table for the count items functions for the given section. * - * @param string $section The section + * @param ?string $section The section * * @return string|null * * @since 4.0.0 */ - protected function getTableNameForSection(string $section = null) + protected function getTableNameForSection(?string $section = null) { return null; } @@ -114,13 +114,13 @@ protected function getTableNameForSection(string $section = null) /** * Returns the state column for the count items functions for the given section. * - * @param string $section The section + * @param ?string $section The section * * @return string|null * * @since 4.0.0 */ - protected function getStateColumnForSection(string $section = null) + protected function getStateColumnForSection(?string $section = null) { return 'state'; } diff --git a/libraries/src/Component/Router/RouterFactory.php b/libraries/src/Component/Router/RouterFactory.php index bf8fa9bcbabd2..1afa26a42889a 100644 --- a/libraries/src/Component/Router/RouterFactory.php +++ b/libraries/src/Component/Router/RouterFactory.php @@ -55,13 +55,13 @@ class RouterFactory implements RouterFactoryInterface * The namespace must be like: * Joomla\Component\Content * - * @param string $namespace The namespace - * @param CategoryFactoryInterface $categoryFactory The category object - * @param DatabaseInterface $db The database object + * @param string $namespace The namespace + * @param ?CategoryFactoryInterface $categoryFactory The category object + * @param ?DatabaseInterface $db The database object * * @since 4.0.0 */ - public function __construct($namespace, CategoryFactoryInterface $categoryFactory = null, DatabaseInterface $db = null) + public function __construct($namespace, ?CategoryFactoryInterface $categoryFactory = null, ?DatabaseInterface $db = null) { $this->namespace = $namespace; $this->categoryFactory = $categoryFactory; diff --git a/libraries/src/Date/Date.php b/libraries/src/Date/Date.php index bcddd13a98454..710107125eb43 100644 --- a/libraries/src/Date/Date.php +++ b/libraries/src/Date/Date.php @@ -424,15 +424,15 @@ public function toISO8601($local = false) /** * Gets the date as an SQL datetime string. * - * @param boolean $local True to return the date string in the local time zone, false to return it in GMT. - * @param DatabaseDriver $db The database driver or null to use Factory::getDbo() + * @param boolean $local True to return the date string in the local time zone, false to return it in GMT. + * @param ?DatabaseDriver $db The database driver or null to use Factory::getDbo() * * @return string The date string in SQL datetime format. * * @link http://dev.mysql.com/doc/refman/5.0/en/datetime.html * @since 2.5.0 */ - public function toSql($local = false, DatabaseDriver $db = null) + public function toSql($local = false, ?DatabaseDriver $db = null) { if ($db === null) { $db = Factory::getDbo(); diff --git a/libraries/src/Dispatcher/ComponentDispatcherFactory.php b/libraries/src/Dispatcher/ComponentDispatcherFactory.php index ab1289dd74499..067a2b9212709 100644 --- a/libraries/src/Dispatcher/ComponentDispatcherFactory.php +++ b/libraries/src/Dispatcher/ComponentDispatcherFactory.php @@ -60,13 +60,13 @@ public function __construct(string $namespace, MVCFactoryInterface $mvcFactory) * Creates a dispatcher. * * @param CMSApplicationInterface $application The application - * @param Input $input The input object, defaults to the one in the application + * @param ?Input $input The input object, defaults to the one in the application * * @return DispatcherInterface * * @since 4.0.0 */ - public function createDispatcher(CMSApplicationInterface $application, Input $input = null): DispatcherInterface + public function createDispatcher(CMSApplicationInterface $application, ?Input $input = null): DispatcherInterface { $name = ucfirst($application->getName()); diff --git a/libraries/src/Dispatcher/ComponentDispatcherFactoryInterface.php b/libraries/src/Dispatcher/ComponentDispatcherFactoryInterface.php index c7d11268cd44a..4f84b7647f374 100644 --- a/libraries/src/Dispatcher/ComponentDispatcherFactoryInterface.php +++ b/libraries/src/Dispatcher/ComponentDispatcherFactoryInterface.php @@ -27,11 +27,11 @@ interface ComponentDispatcherFactoryInterface * Creates a dispatcher. * * @param CMSApplicationInterface $application The application - * @param Input $input The input object, defaults to the one in the application + * @param ?Input $input The input object, defaults to the one in the application * * @return DispatcherInterface * * @since 4.0.0 */ - public function createDispatcher(CMSApplicationInterface $application, Input $input = null): DispatcherInterface; + public function createDispatcher(CMSApplicationInterface $application, ?Input $input = null): DispatcherInterface; } diff --git a/libraries/src/Dispatcher/ModuleDispatcherFactory.php b/libraries/src/Dispatcher/ModuleDispatcherFactory.php index 360c06c477c47..aed4685ae1109 100644 --- a/libraries/src/Dispatcher/ModuleDispatcherFactory.php +++ b/libraries/src/Dispatcher/ModuleDispatcherFactory.php @@ -49,13 +49,13 @@ public function __construct(string $namespace) * * @param \stdClass $module The module * @param CMSApplicationInterface $application The application - * @param Input $input The input object, defaults to the one in the application + * @param ?Input $input The input object, defaults to the one in the application * * @return DispatcherInterface * * @since 4.0.0 */ - public function createDispatcher(\stdClass $module, CMSApplicationInterface $application, Input $input = null): DispatcherInterface + public function createDispatcher(\stdClass $module, CMSApplicationInterface $application, ?Input $input = null): DispatcherInterface { $name = 'Site'; diff --git a/libraries/src/Dispatcher/ModuleDispatcherFactoryInterface.php b/libraries/src/Dispatcher/ModuleDispatcherFactoryInterface.php index a4f5535aac3d9..3df7d7d7c8fbd 100644 --- a/libraries/src/Dispatcher/ModuleDispatcherFactoryInterface.php +++ b/libraries/src/Dispatcher/ModuleDispatcherFactoryInterface.php @@ -28,11 +28,11 @@ interface ModuleDispatcherFactoryInterface * * @param \stdClass $module The module * @param CMSApplicationInterface $application The application - * @param Input $input The input object, defaults to the one in the application + * @param ?Input $input The input object, defaults to the one in the application * * @return DispatcherInterface * * @since 4.0.0 */ - public function createDispatcher(\stdClass $module, CMSApplicationInterface $application, Input $input = null): DispatcherInterface; + public function createDispatcher(\stdClass $module, CMSApplicationInterface $application, ?Input $input = null): DispatcherInterface; } diff --git a/libraries/src/Document/Document.php b/libraries/src/Document/Document.php index 91b697c385406..7ef30a00167b9 100644 --- a/libraries/src/Document/Document.php +++ b/libraries/src/Document/Document.php @@ -325,7 +325,7 @@ public function __construct($options = []) if (\array_key_exists('webAssetManager', $options)) { $this->setWebAssetManager($options['webAssetManager']); } else { - $webAssetManager = new WebAssetManager(\Joomla\CMS\Factory::getContainer()->get('webassetregistry')); + $webAssetManager = new WebAssetManager(CmsFactory::getContainer()->get('webassetregistry')); $this->setWebAssetManager($webAssetManager); } diff --git a/libraries/src/Document/PreloadManager.php b/libraries/src/Document/PreloadManager.php index 4ab762fca5805..a8ce78bc5bb69 100644 --- a/libraries/src/Document/PreloadManager.php +++ b/libraries/src/Document/PreloadManager.php @@ -39,7 +39,7 @@ class PreloadManager implements PreloadManagerInterface * * @since 4.0.0 */ - public function __construct(EvolvableLinkProviderInterface $linkProvider = null) + public function __construct(?EvolvableLinkProviderInterface $linkProvider = null) { $this->linkProvider = $linkProvider ?: new GenericLinkProvider(); } diff --git a/libraries/src/Editor/Editor.php b/libraries/src/Editor/Editor.php index 0663a3a4e0a79..02bb21ecd9831 100644 --- a/libraries/src/Editor/Editor.php +++ b/libraries/src/Editor/Editor.php @@ -86,13 +86,13 @@ class Editor implements DispatcherAwareInterface /** * Constructor * - * @param string $editor The editor name - * @param DispatcherInterface|null $dispatcher The event dispatcher we're going to use - * @param EditorsRegistry|null $registry The editors registry + * @param string $editor The editor name + * @param ?DispatcherInterface $dispatcher The event dispatcher we're going to use + * @param ?EditorsRegistry $registry The editors registry * * @since 1.5 */ - public function __construct(string $editor = 'none', DispatcherInterface $dispatcher = null, EditorsRegistry $registry = null) + public function __construct(string $editor = 'none', ?DispatcherInterface $dispatcher = null, ?EditorsRegistry $registry = null) { $this->_name = $editor; diff --git a/libraries/src/Extension/Module.php b/libraries/src/Extension/Module.php index ca9a87f230509..c925ee82043d9 100644 --- a/libraries/src/Extension/Module.php +++ b/libraries/src/Extension/Module.php @@ -64,13 +64,13 @@ public function __construct(ModuleDispatcherFactoryInterface $dispatcherFactory, * * @param \stdClass $module The module * @param CMSApplicationInterface $application The application - * @param Input $input The input object, defaults to the one in the application + * @param ?Input $input The input object, defaults to the one in the application * * @return DispatcherInterface * * @since 4.0.0 */ - public function getDispatcher(\stdClass $module, CMSApplicationInterface $application, Input $input = null): DispatcherInterface + public function getDispatcher(\stdClass $module, CMSApplicationInterface $application, ?Input $input = null): DispatcherInterface { $dispatcher = $this->dispatcherFactory->createDispatcher($module, $application, $input); diff --git a/libraries/src/Extension/ModuleInterface.php b/libraries/src/Extension/ModuleInterface.php index f4ca106440972..0fd9f61a3c763 100644 --- a/libraries/src/Extension/ModuleInterface.php +++ b/libraries/src/Extension/ModuleInterface.php @@ -29,11 +29,11 @@ interface ModuleInterface * * @param \stdClass $module The module * @param CMSApplicationInterface $application The application - * @param Input $input The input object, defaults to the one in the application + * @param ?Input $input The input object, defaults to the one in the application * * @return DispatcherInterface * * @since 4.0.0 */ - public function getDispatcher(\stdClass $module, CMSApplicationInterface $application, Input $input = null): DispatcherInterface; + public function getDispatcher(\stdClass $module, CMSApplicationInterface $application, ?Input $input = null): DispatcherInterface; } diff --git a/libraries/src/Feed/FeedParser.php b/libraries/src/Feed/FeedParser.php index 67e4a32ccde78..59145db2f6186 100644 --- a/libraries/src/Feed/FeedParser.php +++ b/libraries/src/Feed/FeedParser.php @@ -58,12 +58,12 @@ abstract class FeedParser /** * Constructor. * - * @param \XMLReader $stream The XMLReader stream object for the feed. - * @param InputFilter $inputFilter The InputFilter object to be used + * @param \XMLReader $stream The XMLReader stream object for the feed. + * @param ?InputFilter $inputFilter The InputFilter object to be used * * @since 3.1.4 */ - public function __construct(\XMLReader $stream, InputFilter $inputFilter = null) + public function __construct(\XMLReader $stream, ?InputFilter $inputFilter = null) { $this->stream = $stream; $this->inputFilter = $inputFilter ?: InputFilter::getInstance([], [], 1, 1); diff --git a/libraries/src/Form/Field/CalendarField.php b/libraries/src/Form/Field/CalendarField.php index 0c776581af4e8..6ce7b6bd0d75f 100644 --- a/libraries/src/Form/Field/CalendarField.php +++ b/libraries/src/Form/Field/CalendarField.php @@ -385,7 +385,7 @@ protected function getLayoutData() * * @since 4.0.0 */ - public function filter($value, $group = null, Registry $input = null) + public function filter($value, $group = null, ?Registry $input = null) { // Make sure there is a valid SimpleXMLElement. if (!($this->element instanceof \SimpleXMLElement)) { diff --git a/libraries/src/Form/Field/SubformField.php b/libraries/src/Form/Field/SubformField.php index a9462165b10e9..828607166aa02 100644 --- a/libraries/src/Form/Field/SubformField.php +++ b/libraries/src/Form/Field/SubformField.php @@ -400,14 +400,14 @@ protected function loadSubFormData(Form $subForm) * @param mixed $value The optional value to use as the default for the field. * @param string $group The optional dot-separated form group path on which to find the field. * @param ?Registry $input An optional Registry object with the entire data set to filter - * against the entire form. + * against the entire form. * * @return mixed The filtered value. * * @since 4.0.0 * @throws \UnexpectedValueException */ - public function filter($value, $group = null, Registry $input = null) + public function filter($value, $group = null, ?Registry $input = null) { // Make sure there is a valid SimpleXMLElement. if (!($this->element instanceof \SimpleXMLElement)) { diff --git a/libraries/src/Form/Filter/IntarrayFilter.php b/libraries/src/Form/Filter/IntarrayFilter.php index 5c2664089bd92..f3eab0b540ec8 100644 --- a/libraries/src/Form/Filter/IntarrayFilter.php +++ b/libraries/src/Form/Filter/IntarrayFilter.php @@ -40,7 +40,7 @@ class IntarrayFilter implements FormFilterInterface * * @since 4.0.0 */ - public function filter(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function filter(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { if (strtoupper((string) $element['filter']) === 'INT_ARRAY') { @trigger_error('`INT_ARRAY` form filter is deprecated and will be removed in 5.0. Use `Intarray` instead', E_USER_DEPRECATED); diff --git a/libraries/src/Form/Filter/RawFilter.php b/libraries/src/Form/Filter/RawFilter.php index 1cd9b23418710..b65f9bb1aaf2f 100644 --- a/libraries/src/Form/Filter/RawFilter.php +++ b/libraries/src/Form/Filter/RawFilter.php @@ -39,7 +39,7 @@ class RawFilter implements FormFilterInterface * * @since 4.0.0 */ - public function filter(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function filter(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { return $value; } diff --git a/libraries/src/Form/Filter/RulesFilter.php b/libraries/src/Form/Filter/RulesFilter.php index bee3a3aede315..6e9c03b38b580 100644 --- a/libraries/src/Form/Filter/RulesFilter.php +++ b/libraries/src/Form/Filter/RulesFilter.php @@ -39,7 +39,7 @@ class RulesFilter implements FormFilterInterface * * @since 4.0.0 */ - public function filter(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function filter(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $return = []; diff --git a/libraries/src/Form/Filter/SafehtmlFilter.php b/libraries/src/Form/Filter/SafehtmlFilter.php index 318cc4f922a77..2407df9ef568d 100644 --- a/libraries/src/Form/Filter/SafehtmlFilter.php +++ b/libraries/src/Form/Filter/SafehtmlFilter.php @@ -40,7 +40,7 @@ class SafehtmlFilter implements FormFilterInterface * * @since 4.0.0 */ - public function filter(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function filter(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { return InputFilter::getInstance( [], diff --git a/libraries/src/Form/Filter/TelFilter.php b/libraries/src/Form/Filter/TelFilter.php index 44439be358429..704d002ef0214 100644 --- a/libraries/src/Form/Filter/TelFilter.php +++ b/libraries/src/Form/Filter/TelFilter.php @@ -39,7 +39,7 @@ class TelFilter implements FormFilterInterface * * @since 4.0.0 */ - public function filter(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function filter(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $value = trim($value); diff --git a/libraries/src/Form/Filter/UnsetFilter.php b/libraries/src/Form/Filter/UnsetFilter.php index bb74f437d4807..5ff899cf96c3e 100644 --- a/libraries/src/Form/Filter/UnsetFilter.php +++ b/libraries/src/Form/Filter/UnsetFilter.php @@ -39,7 +39,7 @@ class UnsetFilter implements FormFilterInterface * * @since 4.0.0 */ - public function filter(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function filter(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { return null; } diff --git a/libraries/src/Form/Filter/UrlFilter.php b/libraries/src/Form/Filter/UrlFilter.php index c74ef0ed56617..7748184320481 100644 --- a/libraries/src/Form/Filter/UrlFilter.php +++ b/libraries/src/Form/Filter/UrlFilter.php @@ -42,7 +42,7 @@ class UrlFilter implements FormFilterInterface * * @since 4.0.0 */ - public function filter(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function filter(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { if (empty($value)) { return false; diff --git a/libraries/src/Form/FormFactoryAwareTrait.php b/libraries/src/Form/FormFactoryAwareTrait.php index b4fd3aedff608..585acb41801a2 100644 --- a/libraries/src/Form/FormFactoryAwareTrait.php +++ b/libraries/src/Form/FormFactoryAwareTrait.php @@ -54,7 +54,7 @@ public function getFormFactory(): FormFactoryInterface * * @since 4.0.0 */ - public function setFormFactory(FormFactoryInterface $formFactory = null) + public function setFormFactory(?FormFactoryInterface $formFactory = null) { $this->formFactory = $formFactory; diff --git a/libraries/src/Form/FormField.php b/libraries/src/Form/FormField.php index 65102767654ab..bf8e13bbf3fca 100644 --- a/libraries/src/Form/FormField.php +++ b/libraries/src/Form/FormField.php @@ -1073,7 +1073,7 @@ public function renderField($options = []) * @since 4.0.0 * @throws \UnexpectedValueException */ - public function filter($value, $group = null, Registry $input = null) + public function filter($value, $group = null, ?Registry $input = null) { // Make sure there is a valid SimpleXMLElement. if (!($this->element instanceof \SimpleXMLElement)) { @@ -1169,7 +1169,7 @@ public function filter($value, $group = null, Registry $input = null) * @throws \InvalidArgumentException * @throws \UnexpectedValueException */ - public function validate($value, $group = null, Registry $input = null) + public function validate($value, $group = null, ?Registry $input = null) { // Make sure there is a valid SimpleXMLElement. if (!($this->element instanceof \SimpleXMLElement)) { @@ -1286,7 +1286,7 @@ public function validate($value, $group = null, Registry $input = null) * * @since 4.0.0 */ - public function postProcess($value, $group = null, Registry $input = null) + public function postProcess($value, $group = null, ?Registry $input = null) { return $value; } diff --git a/libraries/src/Form/FormFilterInterface.php b/libraries/src/Form/FormFilterInterface.php index dc7387aac9b75..7b26eb6e6f68e 100644 --- a/libraries/src/Form/FormFilterInterface.php +++ b/libraries/src/Form/FormFilterInterface.php @@ -37,5 +37,5 @@ interface FormFilterInterface * * @since 4.0.0 */ - public function filter(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null); + public function filter(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null); } diff --git a/libraries/src/Form/FormRule.php b/libraries/src/Form/FormRule.php index 0214326571bb6..4e55541341dd6 100644 --- a/libraries/src/Form/FormRule.php +++ b/libraries/src/Form/FormRule.php @@ -69,7 +69,7 @@ class FormRule * @since 1.6 * @throws \UnexpectedValueException if rule is invalid. */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // Check for a valid regex. if (empty($this->regex)) { diff --git a/libraries/src/Form/Rule/CalendarRule.php b/libraries/src/Form/Rule/CalendarRule.php index 61125e1760294..243b8d8761a2f 100644 --- a/libraries/src/Form/Rule/CalendarRule.php +++ b/libraries/src/Form/Rule/CalendarRule.php @@ -41,7 +41,7 @@ class CalendarRule extends FormRule * * @since 3.7.0 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // If the field is empty and not required, the field is valid. $required = ((string) $element['required'] === 'true' || (string) $element['required'] === 'required'); diff --git a/libraries/src/Form/Rule/CaptchaRule.php b/libraries/src/Form/Rule/CaptchaRule.php index c0f42945423b1..9e8e4573ecb5e 100644 --- a/libraries/src/Form/Rule/CaptchaRule.php +++ b/libraries/src/Form/Rule/CaptchaRule.php @@ -41,7 +41,7 @@ class CaptchaRule extends FormRule * * @since 2.5 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $app = Factory::getApplication(); $default = $app->get('captcha'); diff --git a/libraries/src/Form/Rule/ColorRule.php b/libraries/src/Form/Rule/ColorRule.php index 908ed374bc8fe..c74f517695dcc 100644 --- a/libraries/src/Form/Rule/ColorRule.php +++ b/libraries/src/Form/Rule/ColorRule.php @@ -39,7 +39,7 @@ class ColorRule extends FormRule * * @since 1.7.0 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $value = trim($value); diff --git a/libraries/src/Form/Rule/CssIdentifierRule.php b/libraries/src/Form/Rule/CssIdentifierRule.php index d0da9d5128734..bf06923be0b3a 100644 --- a/libraries/src/Form/Rule/CssIdentifierRule.php +++ b/libraries/src/Form/Rule/CssIdentifierRule.php @@ -39,7 +39,7 @@ class CssIdentifierRule extends FormRule * * @since 4.0.0 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // If the field is empty and not required, the field is valid. $required = ((string) $element['required'] === 'true' || (string) $element['required'] === 'required'); diff --git a/libraries/src/Form/Rule/CssIdentifierSubstringRule.php b/libraries/src/Form/Rule/CssIdentifierSubstringRule.php index 8d8f6362f59f0..91eee4bd17ab9 100644 --- a/libraries/src/Form/Rule/CssIdentifierSubstringRule.php +++ b/libraries/src/Form/Rule/CssIdentifierSubstringRule.php @@ -39,7 +39,7 @@ class CssIdentifierSubstringRule extends FormRule * * @since 3.10.7 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // If the field is empty and not required, the field is valid. $required = ((string) $element['required'] === 'true' || (string) $element['required'] === 'required'); diff --git a/libraries/src/Form/Rule/EmailRule.php b/libraries/src/Form/Rule/EmailRule.php index c23461f21f847..ce66dc071e732 100644 --- a/libraries/src/Form/Rule/EmailRule.php +++ b/libraries/src/Form/Rule/EmailRule.php @@ -58,7 +58,7 @@ class EmailRule extends FormRule implements DatabaseAwareInterface * @since 1.7.0 * @throws \UnexpectedValueException */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // If the field is empty and not required, the field is valid. $required = ((string) $element['required'] === 'true' || (string) $element['required'] === 'required'); diff --git a/libraries/src/Form/Rule/EqualsRule.php b/libraries/src/Form/Rule/EqualsRule.php index ed160c3cdccba..a2fc1123accbb 100644 --- a/libraries/src/Form/Rule/EqualsRule.php +++ b/libraries/src/Form/Rule/EqualsRule.php @@ -43,7 +43,7 @@ class EqualsRule extends FormRule * @throws \InvalidArgumentException * @throws \UnexpectedValueException */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $field = (string) $element['field']; diff --git a/libraries/src/Form/Rule/ExistsRule.php b/libraries/src/Form/Rule/ExistsRule.php index 8fa57f8952af8..d313c5a5a7381 100644 --- a/libraries/src/Form/Rule/ExistsRule.php +++ b/libraries/src/Form/Rule/ExistsRule.php @@ -43,7 +43,7 @@ class ExistsRule extends FormRule implements DatabaseAwareInterface * * @since 3.9.0 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $value = trim($value); diff --git a/libraries/src/Form/Rule/FilePathRule.php b/libraries/src/Form/Rule/FilePathRule.php index e58f8d106aa6a..884e318f39dd5 100644 --- a/libraries/src/Form/Rule/FilePathRule.php +++ b/libraries/src/Form/Rule/FilePathRule.php @@ -40,7 +40,7 @@ class FilePathRule extends FormRule * * @since 3.9.21 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $value = trim($value); diff --git a/libraries/src/Form/Rule/FolderPathExistsRule.php b/libraries/src/Form/Rule/FolderPathExistsRule.php index 5837604b0dacf..96f1bf8215a47 100644 --- a/libraries/src/Form/Rule/FolderPathExistsRule.php +++ b/libraries/src/Form/Rule/FolderPathExistsRule.php @@ -39,7 +39,7 @@ class FolderPathExistsRule extends FilePathRule * * @since 4.0.0 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { if (!parent::test($element, $value, $group, $input, $form)) { return false; diff --git a/libraries/src/Form/Rule/NotequalsRule.php b/libraries/src/Form/Rule/NotequalsRule.php index 977eb5869427a..eb9e8d24cd035 100644 --- a/libraries/src/Form/Rule/NotequalsRule.php +++ b/libraries/src/Form/Rule/NotequalsRule.php @@ -43,7 +43,7 @@ class NotequalsRule extends FormRule * @throws \InvalidArgumentException * @throws \UnexpectedValueException */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $field = (string) $element['field']; diff --git a/libraries/src/Form/Rule/NumberRule.php b/libraries/src/Form/Rule/NumberRule.php index 2f3f75263c846..47791c019533d 100644 --- a/libraries/src/Form/Rule/NumberRule.php +++ b/libraries/src/Form/Rule/NumberRule.php @@ -39,7 +39,7 @@ class NumberRule extends FormRule * * @since 3.5 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // Check if the field is required. $required = ((string) $element['required'] === 'true' || (string) $element['required'] === 'required'); diff --git a/libraries/src/Form/Rule/OptionsRule.php b/libraries/src/Form/Rule/OptionsRule.php index 9cdc9a13af1ac..8ce828fe6b87f 100644 --- a/libraries/src/Form/Rule/OptionsRule.php +++ b/libraries/src/Form/Rule/OptionsRule.php @@ -40,7 +40,7 @@ class OptionsRule extends FormRule * * @since 1.7.0 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // Check if the field is required. $required = ((string) $element['required'] === 'true' || (string) $element['required'] === 'required'); diff --git a/libraries/src/Form/Rule/PasswordRule.php b/libraries/src/Form/Rule/PasswordRule.php index 27c516bfaa67d..9a3279a1b9acb 100644 --- a/libraries/src/Form/Rule/PasswordRule.php +++ b/libraries/src/Form/Rule/PasswordRule.php @@ -46,7 +46,7 @@ class PasswordRule extends FormRule * @throws \InvalidArgumentException * @throws \UnexpectedValueException */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { $meter = isset($element['strengthmeter']) ? ' meter="0"' : '1'; $threshold = isset($element['threshold']) ? (int) $element['threshold'] : 66; diff --git a/libraries/src/Form/Rule/RegexRule.php b/libraries/src/Form/Rule/RegexRule.php index 2a2e570569c49..1204dd04a9d0d 100644 --- a/libraries/src/Form/Rule/RegexRule.php +++ b/libraries/src/Form/Rule/RegexRule.php @@ -40,7 +40,7 @@ class RegexRule extends FormRule * @since 5.1.0 * @throws \UnexpectedValueException if rule is invalid. */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { if ((string) $element['validate_regex']) { $this->regex = (string) $element['validate_regex']; diff --git a/libraries/src/Form/Rule/RulesRule.php b/libraries/src/Form/Rule/RulesRule.php index 01d483999c0b1..5e8ff4a61d931 100644 --- a/libraries/src/Form/Rule/RulesRule.php +++ b/libraries/src/Form/Rule/RulesRule.php @@ -40,7 +40,7 @@ class RulesRule extends FormRule * * @since 1.7.0 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // Get the possible field actions and the ones posted to validate them. $fieldActions = self::getFieldActions($element); diff --git a/libraries/src/Form/Rule/ShowOnRule.php b/libraries/src/Form/Rule/ShowOnRule.php index 501e77451a29e..22fa68ee03625 100644 --- a/libraries/src/Form/Rule/ShowOnRule.php +++ b/libraries/src/Form/Rule/ShowOnRule.php @@ -36,20 +36,20 @@ class ShowOnRule extends FormRule /** * Method to test the value. * - * @param \SimpleXMLElement $element The SimpleXMLElement object representing the `` tag for the form field object. - * @param mixed $value The form field value to validate. - * @param string $group The field name group control value. This acts as as an array container for the field. - * For example if the field has name="foo" and the group value is set to "bar" then the - * full field name would end up being "bar[foo]". - * @param ?Registry $input An optional Registry object with the entire data set to validate against the entire form. - * @param ?Form $form The form object for which the field is being tested. + * @param \SimpleXMLElement $element The SimpleXMLElement object representing the `` tag for the form field object. + * @param mixed $value The form field value to validate. + * @param string $group The field name group control value. This acts as as an array container for the field. + * For example if the field has name="foo" and the group value is set to "bar" then the + * full field name would end up being "bar[foo]". + * @param ?Registry $input An optional Registry object with the entire data set to validate against the entire form. + * @param ?Form $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @throws \UnexpectedValueException if rule is invalid. * @since 5.0.0 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // If the field is empty and not required, the field is valid. $required = ((string)$element['required'] === 'true' || (string)$element['required'] === 'required'); diff --git a/libraries/src/Form/Rule/SubformRule.php b/libraries/src/Form/Rule/SubformRule.php index 6a822763a0c89..163f7d38679f7 100644 --- a/libraries/src/Form/Rule/SubformRule.php +++ b/libraries/src/Form/Rule/SubformRule.php @@ -40,7 +40,7 @@ class SubformRule extends FormRule * * @since 3.9.7 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // Get the form field object. $field = $form->getField($element['name'], $group); diff --git a/libraries/src/Form/Rule/TelRule.php b/libraries/src/Form/Rule/TelRule.php index a1f23a7625093..f65bd91b419b1 100644 --- a/libraries/src/Form/Rule/TelRule.php +++ b/libraries/src/Form/Rule/TelRule.php @@ -39,7 +39,7 @@ class TelRule extends FormRule * * @since 1.7.0 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // If the field is empty and not required, the field is valid. $required = ((string) $element['required'] === 'true' || (string) $element['required'] === 'required'); diff --git a/libraries/src/Form/Rule/TimeRule.php b/libraries/src/Form/Rule/TimeRule.php index eb33b7f64993f..69b3be2871ac9 100644 --- a/libraries/src/Form/Rule/TimeRule.php +++ b/libraries/src/Form/Rule/TimeRule.php @@ -43,7 +43,7 @@ class TimeRule extends FormRule * * @throws \Exception */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null): bool + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null): bool { // Check if the field is required. $required = ((string) $element['required'] === 'true' || (string) $element['required'] === 'required'); diff --git a/libraries/src/Form/Rule/UrlRule.php b/libraries/src/Form/Rule/UrlRule.php index e6a38457a3f01..8b6c7dcce8e3e 100644 --- a/libraries/src/Form/Rule/UrlRule.php +++ b/libraries/src/Form/Rule/UrlRule.php @@ -45,7 +45,7 @@ class UrlRule extends FormRule * @link https://www.w3.org/Addressing/URL/url-spec.txt * @see \Joomla\String\StringHelper */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // If the field is empty and not required, the field is valid. $required = ((string) $element['required'] === 'true' || (string) $element['required'] === 'required'); diff --git a/libraries/src/Form/Rule/UserIdRule.php b/libraries/src/Form/Rule/UserIdRule.php index 5a50c499d404b..2babb2c7811a1 100644 --- a/libraries/src/Form/Rule/UserIdRule.php +++ b/libraries/src/Form/Rule/UserIdRule.php @@ -44,7 +44,7 @@ class UserIdRule extends FormRule implements DatabaseAwareInterface * * @since 4.0.0 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // Check if the field is required. $required = ((string) $element['required'] === 'true' || (string) $element['required'] === 'required'); diff --git a/libraries/src/Form/Rule/UsernameRule.php b/libraries/src/Form/Rule/UsernameRule.php index a58c4e51ef6e3..304b19b7a1c79 100644 --- a/libraries/src/Form/Rule/UsernameRule.php +++ b/libraries/src/Form/Rule/UsernameRule.php @@ -44,7 +44,7 @@ class UsernameRule extends FormRule implements DatabaseAwareInterface * * @since 1.7.0 */ - public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) + public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // Get the database object and a new query object. $db = $this->getDatabase(); diff --git a/libraries/src/HTML/HTMLRegistryAwareTrait.php b/libraries/src/HTML/HTMLRegistryAwareTrait.php index 30b12b4439bdd..2e18ca040d023 100644 --- a/libraries/src/HTML/HTMLRegistryAwareTrait.php +++ b/libraries/src/HTML/HTMLRegistryAwareTrait.php @@ -48,13 +48,13 @@ public function getRegistry() /** * Set the registry to use. * - * @param Registry $registry The registry + * @param ?Registry $registry The registry * * @return void * * @since 4.0.0 */ - public function setRegistry(Registry $registry = null) + public function setRegistry(?Registry $registry = null) { $this->registry = $registry; } diff --git a/libraries/src/Http/Http.php b/libraries/src/Http/Http.php index f4020d2d59864..a49ba3f8ab9c9 100644 --- a/libraries/src/Http/Http.php +++ b/libraries/src/Http/Http.php @@ -26,14 +26,14 @@ class Http extends FrameworkHttp /** * Constructor. * - * @param array|\ArrayAccess $options Client options array. If the registry contains any headers.* elements, - * these will be added to the request headers. - * @param FrameworkTransportInterface $transport The HTTP transport object. + * @param array|\ArrayAccess $options Client options array. If the registry contains any headers.* elements, + * these will be added to the request headers. + * @param ?FrameworkTransportInterface $transport The HTTP transport object. * * @since 1.7.3 * @throws \InvalidArgumentException */ - public function __construct($options = [], FrameworkTransportInterface $transport = null) + public function __construct($options = [], ?FrameworkTransportInterface $transport = null) { if (!\is_array($options) && !($options instanceof \ArrayAccess)) { throw new \InvalidArgumentException( diff --git a/libraries/src/Input/Cli.php b/libraries/src/Input/Cli.php index 443202f6e9ee8..1a7210809ff82 100644 --- a/libraries/src/Input/Cli.php +++ b/libraries/src/Input/Cli.php @@ -51,15 +51,15 @@ class Cli extends Input /** * Constructor. * - * @param array $source Source data (Optional, default is $_REQUEST) - * @param array $options Array of configuration parameters (Optional) + * @param ?array $source Source data (Optional, default is $_REQUEST) + * @param array $options Array of configuration parameters (Optional) * * @since 1.7.0 * * @deprecated 4.3 will be removed in 6.0 * Use the `joomla/console` package instead */ - public function __construct(array $source = null, array $options = []) + public function __construct(?array $source = null, array $options = []) { if (isset($options['filter'])) { $this->filter = $options['filter']; diff --git a/libraries/src/Input/Cookie.php b/libraries/src/Input/Cookie.php index 09acbdb351d09..d12d629a07d1a 100644 --- a/libraries/src/Input/Cookie.php +++ b/libraries/src/Input/Cookie.php @@ -28,15 +28,15 @@ class Cookie extends Input /** * Constructor. * - * @param array $source Ignored. - * @param array $options Array of configuration parameters (Optional) + * @param ?array $source Ignored. + * @param array $options Array of configuration parameters (Optional) * * @since 1.7.0 * * @deprecated 4.3 will be removed in 6.0. * Use Joomla\Input\Cookie instead */ - public function __construct(array $source = null, array $options = []) + public function __construct(?array $source = null, array $options = []) { if (isset($options['filter'])) { $this->filter = $options['filter']; diff --git a/libraries/src/Input/Files.php b/libraries/src/Input/Files.php index 17e5722c499fb..09f57e6b7a943 100644 --- a/libraries/src/Input/Files.php +++ b/libraries/src/Input/Files.php @@ -39,16 +39,16 @@ class Files extends Input /** * The class constructor. * - * @param array $source The source argument is ignored. $_FILES is always used. - * @param array $options An optional array of configuration options: - * filter : a custom InputFilter object. + * @param ?array $source The source argument is ignored. $_FILES is always used. + * @param array $options An optional array of configuration options: + * filter : a custom InputFilter object. * * @since 3.0.0 * * @deprecated 4.3 will be removed in 6.0. * Use Joomla\Input\Files instead */ - public function __construct(array $source = null, array $options = []) + public function __construct(?array $source = null, array $options = []) { if (isset($options['filter'])) { $this->filter = $options['filter']; diff --git a/libraries/src/Input/Json.php b/libraries/src/Input/Json.php index fa3cdba64455c..55a526e3b3ee7 100644 --- a/libraries/src/Input/Json.php +++ b/libraries/src/Input/Json.php @@ -40,15 +40,15 @@ class Json extends Input /** * Constructor. * - * @param array $source Source data (Optional, default is the raw HTTP input decoded from JSON) - * @param array $options Array of configuration parameters (Optional) + * @param ?array $source Source data (Optional, default is the raw HTTP input decoded from JSON) + * @param array $options Array of configuration parameters (Optional) * * @since 3.0.1 * * @deprecated 4.3 will be removed in 6.0. * Use Joomla\Input\Json instead */ - public function __construct(array $source = null, array $options = []) + public function __construct(?array $source = null, array $options = []) { if (isset($options['filter'])) { $this->filter = $options['filter']; diff --git a/libraries/src/Installer/InstallerExtension.php b/libraries/src/Installer/InstallerExtension.php index 15052b485d8a1..7d29fe56a30b8 100644 --- a/libraries/src/Installer/InstallerExtension.php +++ b/libraries/src/Installer/InstallerExtension.php @@ -113,11 +113,11 @@ class InstallerExtension /** * Constructor * - * @param \SimpleXMLElement $element A SimpleXMLElement from which to load data from + * @param ?\SimpleXMLElement $element A SimpleXMLElement from which to load data from * * @since 3.1 */ - public function __construct(\SimpleXMLElement $element = null) + public function __construct(?\SimpleXMLElement $element = null) { if ($element) { $this->type = (string) $element->attributes()->type; diff --git a/libraries/src/Language/LanguageHelper.php b/libraries/src/Language/LanguageHelper.php index 80e3f440ff265..095b3e59d5238 100644 --- a/libraries/src/Language/LanguageHelper.php +++ b/libraries/src/Language/LanguageHelper.php @@ -196,13 +196,13 @@ public static function getLanguages($key = 'default') /** * Get a list of installed languages. * - * @param integer $clientId The client app id. - * @param boolean $processMetaData Fetch Language metadata. - * @param boolean $processManifest Fetch Language manifest. - * @param string $pivot The pivot of the returning array. - * @param string $orderField Field to order the results. - * @param string $orderDirection Direction to order the results. - * @param DatabaseInterface $db Database object to use database queries + * @param integer $clientId The client app id. + * @param boolean $processMetaData Fetch Language metadata. + * @param boolean $processManifest Fetch Language manifest. + * @param string $pivot The pivot of the returning array. + * @param string $orderField Field to order the results. + * @param string $orderDirection Direction to order the results. + * @param ?DatabaseInterface $db Database object to use database queries * * @return array Array with the installed languages. * @@ -215,7 +215,7 @@ public static function getInstalledLanguages( $pivot = 'element', $orderField = null, $orderDirection = null, - DatabaseInterface $db = null + ?DatabaseInterface $db = null ) { static $installedLanguages = null; diff --git a/libraries/src/Language/Multilanguage.php b/libraries/src/Language/Multilanguage.php index 886094c67c955..3b2465702bf5b 100644 --- a/libraries/src/Language/Multilanguage.php +++ b/libraries/src/Language/Multilanguage.php @@ -43,7 +43,7 @@ class Multilanguage * * @since 2.5.4 */ - public static function isEnabled(CMSApplication $app = null, DatabaseInterface $db = null) + public static function isEnabled(?CMSApplication $app = null, ?DatabaseInterface $db = null) { // Flag to avoid doing multiple database queries. static $tested = false; @@ -95,7 +95,7 @@ public static function isEnabled(CMSApplication $app = null, DatabaseInterface $ * * @since 3.5 */ - public static function getSiteHomePages(DatabaseInterface $db = null) + public static function getSiteHomePages(?DatabaseInterface $db = null) { // To avoid doing duplicate database queries. static $multilangSiteHomePages = null; diff --git a/libraries/src/MVC/Controller/AdminController.php b/libraries/src/MVC/Controller/AdminController.php index a9e06e34b253f..30ec59d7c0b96 100644 --- a/libraries/src/MVC/Controller/AdminController.php +++ b/libraries/src/MVC/Controller/AdminController.php @@ -78,7 +78,7 @@ class AdminController extends BaseController * * @since 3.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, ?CMSWebApplicationInterface $app = null, ?Input $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?CMSWebApplicationInterface $app = null, ?Input $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/libraries/src/MVC/Controller/ApiController.php b/libraries/src/MVC/Controller/ApiController.php index a450ee70436e7..b0bde96298aa2 100644 --- a/libraries/src/MVC/Controller/ApiController.php +++ b/libraries/src/MVC/Controller/ApiController.php @@ -104,7 +104,7 @@ class ApiController extends BaseController * @throws \Exception * @since 4.0.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, ?CMSWebApplicationInterface $app = null, ?Input $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?CMSWebApplicationInterface $app = null, ?Input $input = null) { $this->modelState = new CMSObject(); diff --git a/libraries/src/MVC/Controller/BaseController.php b/libraries/src/MVC/Controller/BaseController.php index 55060af9f1808..4cb22b9c9ba77 100644 --- a/libraries/src/MVC/Controller/BaseController.php +++ b/libraries/src/MVC/Controller/BaseController.php @@ -365,7 +365,7 @@ public static function getInstance($prefix, $config = []) * * @since 3.0 */ - public function __construct($config = [], MVCFactoryInterface $factory = null, ?CMSApplicationInterface $app = null, ?Input $input = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?CMSApplicationInterface $app = null, ?Input $input = null) { $this->methods = []; $this->message = null; diff --git a/libraries/src/MVC/Controller/FormController.php b/libraries/src/MVC/Controller/FormController.php index 6144196a41ef9..231fce043c985 100644 --- a/libraries/src/MVC/Controller/FormController.php +++ b/libraries/src/MVC/Controller/FormController.php @@ -101,10 +101,10 @@ class FormController extends BaseController implements FormFactoryAwareInterface */ public function __construct( $config = [], - MVCFactoryInterface $factory = null, + ?MVCFactoryInterface $factory = null, ?CMSWebApplicationInterface $app = null, ?Input $input = null, - FormFactoryInterface $formFactory = null + ?FormFactoryInterface $formFactory = null ) { parent::__construct($config, $factory, $app, $input); diff --git a/libraries/src/MVC/Factory/MVCFactory.php b/libraries/src/MVC/Factory/MVCFactory.php index b2de886101c90..d3f02193c279a 100644 --- a/libraries/src/MVC/Factory/MVCFactory.php +++ b/libraries/src/MVC/Factory/MVCFactory.php @@ -71,12 +71,12 @@ class MVCFactory implements MVCFactoryInterface, FormFactoryAwareInterface, Site * The namespace must be like: * Joomla\Component\Content * - * @param string $namespace The namespace - * @param LoggerInterface|null $logger A logging instance to inject into the controller if required + * @param string $namespace The namespace + * @param ?LoggerInterface $logger A logging instance to inject into the controller if required * * @since 4.0.0 */ - public function __construct($namespace, LoggerInterface $logger = null) + public function __construct($namespace, ?LoggerInterface $logger = null) { $this->namespace = $namespace; $this->logger = $logger; diff --git a/libraries/src/MVC/Model/AdminModel.php b/libraries/src/MVC/Model/AdminModel.php index a2c92bab8b75c..481853af04e5f 100644 --- a/libraries/src/MVC/Model/AdminModel.php +++ b/libraries/src/MVC/Model/AdminModel.php @@ -200,7 +200,7 @@ abstract class AdminModel extends FormModel * @since 1.6 * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null, FormFactoryInterface $formFactory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?FormFactoryInterface $formFactory = null) { parent::__construct($config, $factory, $formFactory); diff --git a/libraries/src/MVC/Model/BaseDatabaseModel.php b/libraries/src/MVC/Model/BaseDatabaseModel.php index 0209c6d7d701a..82e7778cfe5da 100644 --- a/libraries/src/MVC/Model/BaseDatabaseModel.php +++ b/libraries/src/MVC/Model/BaseDatabaseModel.php @@ -82,7 +82,7 @@ abstract class BaseDatabaseModel extends BaseModel implements * @since 3.0 * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { parent::__construct($config); @@ -416,7 +416,7 @@ public function getDbo() * Use setDatabase() instead * Example: $model->setDatabase($db); */ - public function setDbo(DatabaseInterface $db = null) + public function setDbo(?DatabaseInterface $db = null) { if ($db === null) { return; diff --git a/libraries/src/MVC/Model/DatabaseAwareTrait.php b/libraries/src/MVC/Model/DatabaseAwareTrait.php index 9f2421a53748c..2eb1917ee562e 100644 --- a/libraries/src/MVC/Model/DatabaseAwareTrait.php +++ b/libraries/src/MVC/Model/DatabaseAwareTrait.php @@ -72,7 +72,7 @@ public function getDbo() * Use the trait from the database package * Example: \Joomla\Database\DatabaseAwareTrait::setDatabase() */ - public function setDbo(DatabaseInterface $db = null) + public function setDbo(?DatabaseInterface $db = null) { $this->_db = $db; } diff --git a/libraries/src/MVC/Model/FormModel.php b/libraries/src/MVC/Model/FormModel.php index 196b8b94e1a9a..f7e5aadb16f37 100644 --- a/libraries/src/MVC/Model/FormModel.php +++ b/libraries/src/MVC/Model/FormModel.php @@ -55,7 +55,7 @@ abstract class FormModel extends BaseDatabaseModel implements FormFactoryAwareIn * @since 3.6 * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null, FormFactoryInterface $formFactory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?FormFactoryInterface $formFactory = null) { $config['events_map'] = $config['events_map'] ?? []; diff --git a/libraries/src/MVC/Model/ListModel.php b/libraries/src/MVC/Model/ListModel.php index 185fa0e4d7775..92791b5d8960b 100644 --- a/libraries/src/MVC/Model/ListModel.php +++ b/libraries/src/MVC/Model/ListModel.php @@ -134,7 +134,7 @@ class ListModel extends BaseDatabaseModel implements FormFactoryAwareInterface, * @since 1.6 * @throws \Exception */ - public function __construct($config = [], MVCFactoryInterface $factory = null) + public function __construct($config = [], ?MVCFactoryInterface $factory = null) { parent::__construct($config, $factory); diff --git a/libraries/src/MVC/View/JsonApiView.php b/libraries/src/MVC/View/JsonApiView.php index 7726f08edc0e1..a288e5fc90b40 100644 --- a/libraries/src/MVC/View/JsonApiView.php +++ b/libraries/src/MVC/View/JsonApiView.php @@ -104,13 +104,13 @@ public function __construct($config = []) /** * Execute and display a template script. * - * @param array|null $items Array of items + * @param ?array $items Array of items * * @return string * * @since 4.0.0 */ - public function displayList(array $items = null) + public function displayList(?array $items = null) { /** @var \Joomla\CMS\MVC\Model\ListModel $model */ $model = $this->getModel(); diff --git a/libraries/src/Mail/Exception/MailDisabledException.php b/libraries/src/Mail/Exception/MailDisabledException.php index 2e6c96102e1a1..f09255117961b 100644 --- a/libraries/src/Mail/Exception/MailDisabledException.php +++ b/libraries/src/Mail/Exception/MailDisabledException.php @@ -47,14 +47,14 @@ final class MailDisabledException extends \RuntimeException /** * Constructor. * - * @param string $reason The reason why mail is disabled. - * @param string $message The Exception message to throw. - * @param integer $code The Exception code. - * @param \Throwable $previous The previous exception used for the exception chaining. + * @param string $reason The reason why mail is disabled. + * @param string $message The Exception message to throw. + * @param integer $code The Exception code. + * @param ?\Throwable $previous The previous exception used for the exception chaining. * * @since 4.0.0 */ - public function __construct(string $reason, string $message = '', int $code = 0, \Throwable $previous = null) + public function __construct(string $reason, string $message = '', int $code = 0, ?\Throwable $previous = null) { parent::__construct($message, $code, $previous); diff --git a/libraries/src/Mail/MailTemplate.php b/libraries/src/Mail/MailTemplate.php index 2910b22ec5ee8..e570e75b40e4c 100644 --- a/libraries/src/Mail/MailTemplate.php +++ b/libraries/src/Mail/MailTemplate.php @@ -93,13 +93,13 @@ class MailTemplate /** * Constructor for the mail templating class * - * @param string $templateId Id of the mail template. - * @param string $language Language of the template to use. - * @param Mail $mailer Mail object to send the mail with. + * @param string $templateId Id of the mail template. + * @param string $language Language of the template to use. + * @param ?Mail $mailer Mail object to send the mail with. * * @since 4.0.0 */ - public function __construct($templateId, $language, Mail $mailer = null) + public function __construct($templateId, $language, ?Mail $mailer = null) { $this->template_id = $templateId; $this->language = $language; diff --git a/libraries/src/Pagination/Pagination.php b/libraries/src/Pagination/Pagination.php index 48c8a307c52c2..8c25d25edb5db 100644 --- a/libraries/src/Pagination/Pagination.php +++ b/libraries/src/Pagination/Pagination.php @@ -113,15 +113,15 @@ class Pagination /** * Constructor. * - * @param integer $total The total number of items. - * @param integer $limitstart The offset of the item to start at. - * @param integer $limit The number of items to display per page. - * @param string $prefix The prefix used for request variables. - * @param CMSApplication $app The application object + * @param integer $total The total number of items. + * @param integer $limitstart The offset of the item to start at. + * @param integer $limit The number of items to display per page. + * @param string $prefix The prefix used for request variables. + * @param ?CMSApplication $app The application object * * @since 1.5 */ - public function __construct($total, $limitstart, $limit, $prefix = '', CMSApplication $app = null) + public function __construct($total, $limitstart, $limit, $prefix = '', ?CMSApplication $app = null) { // Value/type checking. $this->total = (int) $total; diff --git a/libraries/src/Pathway/SitePathway.php b/libraries/src/Pathway/SitePathway.php index eed24b09a956e..c64bce7bdddf0 100644 --- a/libraries/src/Pathway/SitePathway.php +++ b/libraries/src/Pathway/SitePathway.php @@ -27,11 +27,11 @@ class SitePathway extends Pathway /** * Class constructor. * - * @param SiteApplication $app Application Object + * @param ?SiteApplication $app Application Object * * @since 1.5 */ - public function __construct(SiteApplication $app = null) + public function __construct(?SiteApplication $app = null) { $this->pathway = []; diff --git a/libraries/src/Plugin/PluginHelper.php b/libraries/src/Plugin/PluginHelper.php index 9c3c591e311ae..b35348dd7e15b 100644 --- a/libraries/src/Plugin/PluginHelper.php +++ b/libraries/src/Plugin/PluginHelper.php @@ -150,16 +150,16 @@ public static function isEnabled($type, $plugin = null) * Loads all the plugin files for a particular type if no specific plugin is specified * otherwise only the specific plugin is loaded. * - * @param string $type The plugin type, relates to the subdirectory in the plugins directory. - * @param string $plugin The plugin name. - * @param boolean $autocreate Autocreate the plugin. - * @param DispatcherInterface $dispatcher Optionally allows the plugin to use a different dispatcher. + * @param string $type The plugin type, relates to the subdirectory in the plugins directory. + * @param string $plugin The plugin name. + * @param boolean $autocreate Autocreate the plugin. + * @param ?DispatcherInterface $dispatcher Optionally allows the plugin to use a different dispatcher. * * @return boolean True on success. * * @since 1.5 */ - public static function importPlugin($type, $plugin = null, $autocreate = true, DispatcherInterface $dispatcher = null) + public static function importPlugin($type, $plugin = null, $autocreate = true, ?DispatcherInterface $dispatcher = null) { static $loaded = []; @@ -208,15 +208,15 @@ public static function importPlugin($type, $plugin = null, $autocreate = true, D /** * Loads the plugin file. * - * @param object $plugin The plugin. - * @param boolean $autocreate True to autocreate. - * @param DispatcherInterface $dispatcher Optionally allows the plugin to use a different dispatcher. + * @param object $plugin The plugin. + * @param boolean $autocreate True to autocreate. + * @param ?DispatcherInterface $dispatcher Optionally allows the plugin to use a different dispatcher. * * @return void * * @since 3.2 */ - protected static function import($plugin, $autocreate = true, DispatcherInterface $dispatcher = null) + protected static function import($plugin, $autocreate = true, ?DispatcherInterface $dispatcher = null) { static $plugins = []; diff --git a/libraries/src/Router/Exception/RouteNotFoundException.php b/libraries/src/Router/Exception/RouteNotFoundException.php index f6316d0a894cf..7b96a363642ab 100644 --- a/libraries/src/Router/Exception/RouteNotFoundException.php +++ b/libraries/src/Router/Exception/RouteNotFoundException.php @@ -23,13 +23,13 @@ class RouteNotFoundException extends \InvalidArgumentException /** * Constructor * - * @param string $message The Exception message to throw. - * @param integer $code The Exception code. - * @param \Exception $previous The previous exception used for the exception chaining. + * @param string $message The Exception message to throw. + * @param integer $code The Exception code. + * @param ?\Exception $previous The previous exception used for the exception chaining. * * @since 3.8.0 */ - public function __construct($message = '', $code = 404, \Exception $previous = null) + public function __construct($message = '', $code = 404, ?\Exception $previous = null) { if (empty($message)) { $message = 'URL was not found'; diff --git a/libraries/src/Router/SiteRouter.php b/libraries/src/Router/SiteRouter.php index 601d3069db26f..6ba15e9ce7a02 100644 --- a/libraries/src/Router/SiteRouter.php +++ b/libraries/src/Router/SiteRouter.php @@ -57,12 +57,12 @@ class SiteRouter extends Router /** * Class constructor * - * @param CMSApplication $app Application Object - * @param AbstractMenu $menu Menu object + * @param ?CMSApplication $app Application Object + * @param ?AbstractMenu $menu Menu object * * @since 3.4 */ - public function __construct(CMSApplication $app = null, AbstractMenu $menu = null) + public function __construct(?CMSApplication $app = null, ?AbstractMenu $menu = null) { $this->app = $app ?: Factory::getContainer()->get(SiteApplication::class); $this->menu = $menu ?: $this->app->getMenu(); diff --git a/libraries/src/Serializer/JoomlaSerializer.php b/libraries/src/Serializer/JoomlaSerializer.php index 0f66a25f00767..e2e1bcd551da4 100644 --- a/libraries/src/Serializer/JoomlaSerializer.php +++ b/libraries/src/Serializer/JoomlaSerializer.php @@ -43,13 +43,13 @@ public function __construct(string $type) * Get the attributes array. * * @param array|object $post The data container - * @param array|null $fields The requested fields to be rendered + * @param ?array $fields The requested fields to be rendered * * @return array * * @since 4.0.0 */ - public function getAttributes($post, array $fields = null) + public function getAttributes($post, ?array $fields = null) { if (!\is_array($post) && !\is_object($post)) { $message = sprintf( diff --git a/libraries/src/Session/Session.php b/libraries/src/Session/Session.php index afd6ee44ff2f3..fbcba2eec01a2 100644 --- a/libraries/src/Session/Session.php +++ b/libraries/src/Session/Session.php @@ -31,16 +31,16 @@ class Session extends BaseSession /** * Constructor * - * @param StorageInterface $store A StorageInterface implementation. - * @param DispatcherInterface $dispatcher DispatcherInterface for the session to use. - * @param array $options Optional parameters. Supported keys include: - * - name: The session name - * - id: The session ID - * - expire: The session lifetime in seconds + * @param ?StorageInterface $store A StorageInterface implementation. + * @param ?DispatcherInterface $dispatcher DispatcherInterface for the session to use. + * @param array $options Optional parameters. Supported keys include: + * - name: The session name + * - id: The session ID + * - expire: The session lifetime in seconds * * @since 1.0 */ - public function __construct(StorageInterface $store = null, DispatcherInterface $dispatcher = null, array $options = []) + public function __construct(?StorageInterface $store = null, ?DispatcherInterface $dispatcher = null, array $options = []) { // Extra hash the name of the session for b/c with Joomla 3.x or the session is never found. if (isset($options['name'])) { diff --git a/libraries/src/Session/Storage/JoomlaStorage.php b/libraries/src/Session/Storage/JoomlaStorage.php index f904cd61d2237..8ffee73e34440 100644 --- a/libraries/src/Session/Storage/JoomlaStorage.php +++ b/libraries/src/Session/Storage/JoomlaStorage.php @@ -68,12 +68,12 @@ class JoomlaStorage extends NativeStorage * Constructor * * @param Input $input Input object - * @param \SessionHandlerInterface $handler Session save handler + * @param ?\SessionHandlerInterface $handler Session save handler * @param array $options Session options * * @since 4.0.0 */ - public function __construct(Input $input, \SessionHandlerInterface $handler = null, array $options = []) + public function __construct(Input $input, ?\SessionHandlerInterface $handler = null, array $options = []) { // Disable transparent sid support and default use cookies $options += [ diff --git a/libraries/src/Table/Asset.php b/libraries/src/Table/Asset.php index 9c8d733fd6887..306a335183f86 100644 --- a/libraries/src/Table/Asset.php +++ b/libraries/src/Table/Asset.php @@ -64,7 +64,7 @@ class Asset extends Nested * * @since 1.7.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__assets', 'id', $db, $dispatcher); } diff --git a/libraries/src/Table/Category.php b/libraries/src/Table/Category.php index c3fd1887c6fc0..71b4af84ccb67 100644 --- a/libraries/src/Table/Category.php +++ b/libraries/src/Table/Category.php @@ -53,7 +53,7 @@ class Category extends Nested implements VersionableTableInterface, TaggableTabl * * @since 1.5 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { /** * @deprecated 4.0 will be removed in 6.0 @@ -96,14 +96,14 @@ protected function _getAssetTitle() /** * Get the parent asset id for the record * - * @param Table $table A Table object for the asset parent. - * @param integer $id The id for the asset + * @param ?Table $table A Table object for the asset parent. + * @param ?integer $id The id for the asset * * @return integer The id of the asset's parent * * @since 1.6 */ - protected function _getAssetParentId(Table $table = null, $id = null) + protected function _getAssetParentId(?Table $table = null, $id = null) { $assetId = null; diff --git a/libraries/src/Table/Content.php b/libraries/src/Table/Content.php index 109cff6d2ec4b..47af9eb96d74c 100644 --- a/libraries/src/Table/Content.php +++ b/libraries/src/Table/Content.php @@ -54,7 +54,7 @@ class Content extends Table implements VersionableTableInterface, TaggableTableI * * @since 1.5 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { $this->typeAlias = 'com_content.article'; @@ -95,14 +95,14 @@ protected function _getAssetTitle() /** * Method to get the parent asset id for the record * - * @param Table $table A Table object (optional) for the asset parent - * @param integer $id The id (optional) of the content. + * @param ?Table $table A Table object (optional) for the asset parent + * @param ?integer $id The id (optional) of the content. * * @return integer * * @since 1.6 */ - protected function _getAssetParentId(Table $table = null, $id = null) + protected function _getAssetParentId(?Table $table = null, $id = null) { $assetId = null; diff --git a/libraries/src/Table/ContentHistory.php b/libraries/src/Table/ContentHistory.php index 5e4a7a0e350ec..232bbbd48e5c1 100644 --- a/libraries/src/Table/ContentHistory.php +++ b/libraries/src/Table/ContentHistory.php @@ -56,7 +56,7 @@ class ContentHistory extends Table implements CurrentUserInterface * * @since 3.1 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__history', 'version_id', $db, $dispatcher); $this->ignoreChanges = [ diff --git a/libraries/src/Table/ContentType.php b/libraries/src/Table/ContentType.php index a6677f5d92184..862e388d0393a 100644 --- a/libraries/src/Table/ContentType.php +++ b/libraries/src/Table/ContentType.php @@ -32,7 +32,7 @@ class ContentType extends Table * * @since 3.1 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__content_types', 'type_id', $db, $dispatcher); } diff --git a/libraries/src/Table/CoreContent.php b/libraries/src/Table/CoreContent.php index f2e8b87510b78..1d7670e3b7ea2 100644 --- a/libraries/src/Table/CoreContent.php +++ b/libraries/src/Table/CoreContent.php @@ -57,7 +57,7 @@ class CoreContent extends Table implements CurrentUserInterface * * @since 3.1 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__ucm_content', 'core_content_id', $db, $dispatcher); diff --git a/libraries/src/Table/Extension.php b/libraries/src/Table/Extension.php index 881c6fb01979c..ea44c18dc6966 100644 --- a/libraries/src/Table/Extension.php +++ b/libraries/src/Table/Extension.php @@ -56,7 +56,7 @@ class Extension extends Table * * @since 1.7.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__extensions', 'extension_id', $db, $dispatcher); diff --git a/libraries/src/Table/Language.php b/libraries/src/Table/Language.php index a3744c9a8d173..78eb9534deae4 100644 --- a/libraries/src/Table/Language.php +++ b/libraries/src/Table/Language.php @@ -32,7 +32,7 @@ class Language extends Table * * @since 1.7.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__languages', 'lang_id', $db, $dispatcher); } @@ -133,14 +133,14 @@ protected function _getAssetTitle() * The extended class can define a table and id to lookup. If the * asset does not exist it will be created. * - * @param Table $table A Table object for the asset parent. - * @param integer $id Id to look up + * @param ?Table $table A Table object for the asset parent. + * @param ?integer $id Id to look up * * @return integer * * @since 3.8.0 */ - protected function _getAssetParentId(Table $table = null, $id = null) + protected function _getAssetParentId(?Table $table = null, $id = null) { $assetId = null; $asset = new Asset($this->getDbo(), $this->getDispatcher()); diff --git a/libraries/src/Table/Menu.php b/libraries/src/Table/Menu.php index 2a86605cf4f67..c035ef32006d1 100644 --- a/libraries/src/Table/Menu.php +++ b/libraries/src/Table/Menu.php @@ -47,7 +47,7 @@ class Menu extends Nested * * @since 1.5 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__menu', 'id', $db, $dispatcher); diff --git a/libraries/src/Table/MenuType.php b/libraries/src/Table/MenuType.php index c2bbcb2767d06..175a46b1cdb1c 100644 --- a/libraries/src/Table/MenuType.php +++ b/libraries/src/Table/MenuType.php @@ -38,7 +38,7 @@ class MenuType extends Table implements CurrentUserInterface * * @since 1.6 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__menu_types', 'id', $db, $dispatcher); } @@ -300,14 +300,14 @@ protected function _getAssetTitle() * The extended class can define a table and id to lookup. If the * asset does not exist it will be created. * - * @param Table $table A Table object for the asset parent. - * @param integer $id Id to look up + * @param ?Table $table A Table object for the asset parent. + * @param ?integer $id Id to look up * * @return integer * * @since 3.6 */ - protected function _getAssetParentId(Table $table = null, $id = null) + protected function _getAssetParentId(?Table $table = null, $id = null) { $assetId = null; $asset = Table::getInstance('asset'); diff --git a/libraries/src/Table/Module.php b/libraries/src/Table/Module.php index 6acebac9b1196..595d9c288ddb7 100644 --- a/libraries/src/Table/Module.php +++ b/libraries/src/Table/Module.php @@ -43,7 +43,7 @@ class Module extends Table * * @since 1.5 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__modules', 'id', $db, $dispatcher); @@ -81,14 +81,14 @@ protected function _getAssetTitle() /** * Method to get the parent asset id for the record * - * @param Table $table A Table object (optional) for the asset parent - * @param integer $id The id (optional) of the content. + * @param ?Table $table A Table object (optional) for the asset parent + * @param ?integer $id The id (optional) of the content. * * @return integer * * @since 3.2 */ - protected function _getAssetParentId(Table $table = null, $id = null) + protected function _getAssetParentId(?Table $table = null, $id = null) { $assetId = null; diff --git a/libraries/src/Table/Table.php b/libraries/src/Table/Table.php index a4d3ba45d1265..f1b6665f02d27 100644 --- a/libraries/src/Table/Table.php +++ b/libraries/src/Table/Table.php @@ -167,7 +167,7 @@ abstract class Table extends \stdClass implements TableInterface, DispatcherAwar * * @since 1.7.0 */ - public function __construct($table, $key, DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct($table, $key, DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { // Set internal variables. $this->_tbl = $table; @@ -424,14 +424,14 @@ protected function _getAssetTitle() * By default, all assets are registered to the ROOT node with ID, which will default to 1 if none exists. * An extended class can define a table and ID to lookup. If the asset does not exist it will be created. * - * @param Table $table A Table object for the asset parent. - * @param integer $id Id to look up + * @param ?Table $table A Table object for the asset parent. + * @param ?integer $id Id to look up * * @return integer * * @since 1.7.0 */ - protected function _getAssetParentId(Table $table = null, $id = null) + protected function _getAssetParentId(?Table $table = null, $id = null) { // For simple cases, parent to the asset root. $assets = new Asset($this->getDbo(), $this->getDispatcher()); diff --git a/libraries/src/Table/Ucm.php b/libraries/src/Table/Ucm.php index b52a93d493812..2018e587d9a58 100644 --- a/libraries/src/Table/Ucm.php +++ b/libraries/src/Table/Ucm.php @@ -31,7 +31,7 @@ class Ucm extends Table * * @since 3.1 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__ucm_base', 'ucm_id', $db, $dispatcher); } diff --git a/libraries/src/Table/Update.php b/libraries/src/Table/Update.php index dcf2df51b6809..7504c2c51d694 100644 --- a/libraries/src/Table/Update.php +++ b/libraries/src/Table/Update.php @@ -41,7 +41,7 @@ class Update extends Table * * @since 1.7.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__updates', 'update_id', $db, $dispatcher); } diff --git a/libraries/src/Table/UpdateSite.php b/libraries/src/Table/UpdateSite.php index 98e864e3d24ee..eae9f525b0f1a 100644 --- a/libraries/src/Table/UpdateSite.php +++ b/libraries/src/Table/UpdateSite.php @@ -33,7 +33,7 @@ class UpdateSite extends Table * * @since 3.4 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__update_sites', 'update_site_id', $db, $dispatcher); } diff --git a/libraries/src/Table/User.php b/libraries/src/Table/User.php index 18af9b9433d86..bb0e7c4c60b83 100644 --- a/libraries/src/Table/User.php +++ b/libraries/src/Table/User.php @@ -56,7 +56,7 @@ class User extends Table * * @since 1.7.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__users', 'id', $db, $dispatcher); diff --git a/libraries/src/Table/Usergroup.php b/libraries/src/Table/Usergroup.php index 824a88af0a49d..fbc964da0d0b7 100644 --- a/libraries/src/Table/Usergroup.php +++ b/libraries/src/Table/Usergroup.php @@ -34,7 +34,7 @@ class Usergroup extends Table * * @since 1.7.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__usergroups', 'id', $db, $dispatcher); } diff --git a/libraries/src/Table/ViewLevel.php b/libraries/src/Table/ViewLevel.php index e6d76b93ba78d..41b01443b7132 100644 --- a/libraries/src/Table/ViewLevel.php +++ b/libraries/src/Table/ViewLevel.php @@ -33,7 +33,7 @@ class ViewLevel extends Table * * @since 1.7.0 */ - public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher = null) + public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__viewlevels', 'id', $db, $dispatcher); } diff --git a/libraries/src/Tag/TagServiceTrait.php b/libraries/src/Tag/TagServiceTrait.php index d18ba07471b34..9cf76315e934c 100644 --- a/libraries/src/Tag/TagServiceTrait.php +++ b/libraries/src/Tag/TagServiceTrait.php @@ -51,13 +51,13 @@ public function countTagItems(array $items, string $extension) /** * Returns the table for the count items functions for the given section. * - * @param string $section The section + * @param ?string $section The section * * @return string|null * * @since 4.0.0 */ - protected function getTableNameForSection(string $section = null) + protected function getTableNameForSection(?string $section = null) { return null; } @@ -65,13 +65,13 @@ protected function getTableNameForSection(string $section = null) /** * Returns the state column for the count items functions for the given section. * - * @param string $section The section + * @param ?string $section The section * * @return string|null * * @since 4.0.0 */ - protected function getStateColumnForSection(string $section = null) + protected function getStateColumnForSection(?string $section = null) { return 'state'; } diff --git a/libraries/src/Toolbar/Toolbar.php b/libraries/src/Toolbar/Toolbar.php index b52958404fe71..4a5904fa96e17 100644 --- a/libraries/src/Toolbar/Toolbar.php +++ b/libraries/src/Toolbar/Toolbar.php @@ -95,12 +95,12 @@ class Toolbar /** * Constructor * - * @param string $name The toolbar name. - * @param ToolbarFactoryInterface $factory The toolbar factory. + * @param string $name The toolbar name. + * @param ?ToolbarFactoryInterface $factory The toolbar factory. * * @since 1.5 */ - public function __construct($name = 'toolbar', ToolbarFactoryInterface $factory = null) + public function __construct($name = 'toolbar', ?ToolbarFactoryInterface $factory = null) { $this->_name = $name; diff --git a/libraries/src/UCM/UCMBase.php b/libraries/src/UCM/UCMBase.php index 9b83ee809c4f6..2fbc2b6580564 100644 --- a/libraries/src/UCM/UCMBase.php +++ b/libraries/src/UCM/UCMBase.php @@ -44,12 +44,12 @@ class UCMBase implements UCM /** * Instantiate the UCMBase. * - * @param string $alias The alias string - * @param UCMType $type The type object + * @param string $alias The alias string + * @param ?UCMType $type The type object * * @since 3.1 */ - public function __construct($alias = null, UCMType $type = null) + public function __construct($alias = null, ?UCMType $type = null) { // Setup dependencies. $input = Factory::getApplication()->getInput(); @@ -61,16 +61,16 @@ public function __construct($alias = null, UCMType $type = null) /** * Store data to the appropriate table * - * @param array $data Data to be stored - * @param TableInterface $table Table Object - * @param string $primaryKey The primary key name + * @param array $data Data to be stored + * @param ?TableInterface $table Table Object + * @param string $primaryKey The primary key name * * @return boolean True on success * * @since 3.1 * @throws \Exception */ - protected function store($data, TableInterface $table = null, $primaryKey = null) + protected function store($data, ?TableInterface $table = null, $primaryKey = null) { if (!$table) { $table = Table::getInstance('Ucm'); @@ -117,14 +117,14 @@ public function getType() /** * Method to map the base ucm fields * - * @param array $original Data array - * @param UCMType $type UCM Content Type + * @param array $original Data array + * @param ?UCMType $type UCM Content Type * * @return array Data array of UCM mappings * * @since 3.1 */ - public function mapBase($original, UCMType $type = null) + public function mapBase($original, ?UCMType $type = null) { $type = $type ?: $this->type; diff --git a/libraries/src/UCM/UCMContent.php b/libraries/src/UCM/UCMContent.php index d5ab7b966f5de..f0c331ade4fcc 100644 --- a/libraries/src/UCM/UCMContent.php +++ b/libraries/src/UCM/UCMContent.php @@ -45,13 +45,13 @@ class UCMContent extends UCMBase /** * Instantiate UCMContent. * - * @param TableInterface $table The table object - * @param string $alias The type alias - * @param UCMType $type The type object + * @param ?TableInterface $table The table object + * @param string $alias The type alias + * @param ?UCMType $type The type object * * @since 3.1 */ - public function __construct(TableInterface $table = null, $alias = null, UCMType $type = null) + public function __construct(?TableInterface $table = null, $alias = null, ?UCMType $type = null) { parent::__construct($alias, $type); @@ -66,14 +66,14 @@ public function __construct(TableInterface $table = null, $alias = null, UCMType /** * Method to save the data * - * @param array $original The original data to be saved - * @param UCMType $type The UCM Type object + * @param array $original The original data to be saved + * @param ?UCMType $type The UCM Type object * * @return boolean true * * @since 3.1 */ - public function save($original = null, UCMType $type = null) + public function save($original = null, ?UCMType $type = null) { $type = $type ?: $this->type; $ucmData = $original ? $this->mapData($original, $type) : $this->ucmData; @@ -93,14 +93,14 @@ public function save($original = null, UCMType $type = null) /** * Delete content from the Core Content table * - * @param mixed $pk Array or comma-separated string of ids to delete - * @param UCMType $type The content type object + * @param mixed $pk Array or comma-separated string of ids to delete + * @param ?UCMType $type The content type object * * @return boolean True if success * * @since 3.1 */ - public function delete($pk, UCMType $type = null) + public function delete($pk, ?UCMType $type = null) { $db = Factory::getDbo(); $type = $type ?: $this->type; @@ -124,14 +124,14 @@ public function delete($pk, UCMType $type = null) /** * Map the original content to the Core Content fields * - * @param array $original The original data array - * @param UCMType $type Type object for this data + * @param array $original The original data array + * @param ?UCMType $type Type object for this data * * @return array[] $ucmData The mapped UCM data * * @since 3.1 */ - public function mapData($original, UCMType $type = null) + public function mapData($original, ?UCMType $type = null) { $contentType = $type ?: $this->type; @@ -172,15 +172,15 @@ public function mapData($original, UCMType $type = null) /** * Store data to the appropriate table * - * @param array $data Data to be stored - * @param TableInterface $table Table Object - * @param boolean $primaryKey Flag that is true for data that are using #__ucm_content as their primary table + * @param array $data Data to be stored + * @param ?TableInterface $table Table Object + * @param boolean $primaryKey Flag that is true for data that are using #__ucm_content as their primary table * * @return boolean true on success * * @since 3.1 */ - protected function store($data, TableInterface $table = null, $primaryKey = null) + protected function store($data, ?TableInterface $table = null, $primaryKey = null) { $table = $table ?: Table::getInstance('CoreContent'); diff --git a/libraries/src/UCM/UCMType.php b/libraries/src/UCM/UCMType.php index 24a0e4dc1297d..be26f721c3d73 100644 --- a/libraries/src/UCM/UCMType.php +++ b/libraries/src/UCM/UCMType.php @@ -85,13 +85,13 @@ class UCMType implements UCM /** * Class constructor * - * @param string $alias The alias for the item - * @param DatabaseDriver $database The database object - * @param AbstractApplication $application The application object + * @param string $alias The alias for the item + * @param ?DatabaseDriver $database The database object + * @param ?AbstractApplication $application The application object * * @since 3.1 */ - public function __construct($alias = null, DatabaseDriver $database = null, AbstractApplication $application = null) + public function __construct($alias = null, ?DatabaseDriver $database = null, ?AbstractApplication $application = null) { $this->db = $database ?: Factory::getDbo(); $app = $application ?: Factory::getApplication(); diff --git a/libraries/src/WebAsset/AssetItem/LangActiveAssetItem.php b/libraries/src/WebAsset/AssetItem/LangActiveAssetItem.php index fa17f1eeb4674..42e2934f60f3b 100644 --- a/libraries/src/WebAsset/AssetItem/LangActiveAssetItem.php +++ b/libraries/src/WebAsset/AssetItem/LangActiveAssetItem.php @@ -27,17 +27,17 @@ class LangActiveAssetItem extends WebAssetItem /** * Class constructor * - * @param string $name The asset name - * @param string $uri The URI for the asset - * @param array $options Additional options for the asset - * @param array $attributes Attributes for the asset - * @param array $dependencies Asset dependencies + * @param string $name The asset name + * @param ?string $uri The URI for the asset + * @param array $options Additional options for the asset + * @param array $attributes Attributes for the asset + * @param array $dependencies Asset dependencies * * @since 4.0.0 */ public function __construct( string $name, - string $uri = null, + ?string $uri = null, array $options = [], array $attributes = [], array $dependencies = [] diff --git a/libraries/src/WebAsset/WebAssetItem.php b/libraries/src/WebAsset/WebAssetItem.php index b7546a7b2afe5..02f05ae273203 100644 --- a/libraries/src/WebAsset/WebAssetItem.php +++ b/libraries/src/WebAsset/WebAssetItem.php @@ -78,17 +78,17 @@ class WebAssetItem implements WebAssetItemInterface /** * Class constructor * - * @param string $name The asset name - * @param string $uri The URI for the asset - * @param array $options Additional options for the asset - * @param array $attributes Attributes for the asset - * @param array $dependencies Asset dependencies + * @param string $name The asset name + * @param ?string $uri The URI for the asset + * @param array $options Additional options for the asset + * @param array $attributes Attributes for the asset + * @param array $dependencies Asset dependencies * * @since 4.0.0 */ public function __construct( string $name, - string $uri = null, + ?string $uri = null, array $options = [], array $attributes = [], array $dependencies = [] diff --git a/libraries/src/WebAsset/WebAssetManager.php b/libraries/src/WebAsset/WebAssetManager.php index 8501feea69853..63b5c88d9c192 100644 --- a/libraries/src/WebAsset/WebAssetManager.php +++ b/libraries/src/WebAsset/WebAssetManager.php @@ -753,14 +753,14 @@ public function getManagerState(): array /** * Update Dependencies state for all active Assets or only for given * - * @param string $type The asset type, script or style - * @param WebAssetItem $asset The asset instance to which need to enable dependencies + * @param ?string $type The asset type, script or style + * @param ?WebAssetItem $asset The asset instance to which need to enable dependencies * * @return self * * @since 4.0.0 */ - protected function enableDependencies(string $type = null, WebAssetItem $asset = null): self + protected function enableDependencies(?string $type = null, ?WebAssetItem $asset = null): self { if ($type === 'preset') { // Preset items already was enabled by usePresetItems() @@ -971,11 +971,11 @@ protected function getConnectionsGraph(array $assets): array /** * Return dependencies for Asset as array of WebAssetItem objects * - * @param string $type The asset type, script or style - * @param WebAssetItem $asset Asset instance - * @param boolean $recursively Whether to search for dependency recursively - * @param string $recursionType The type of initial item to prevent loop - * @param WebAssetItem $recursionRoot Initial item to prevent loop + * @param string $type The asset type, script or style + * @param WebAssetItem $asset Asset instance + * @param boolean $recursively Whether to search for dependency recursively + * @param ?string $recursionType The type of initial item to prevent loop + * @param ?WebAssetItem $recursionRoot Initial item to prevent loop * * @return array * @@ -987,8 +987,8 @@ protected function getDependenciesForAsset( string $type, WebAssetItem $asset, $recursively = false, - string $recursionType = null, - WebAssetItem $recursionRoot = null + ?string $recursionType = null, + ?WebAssetItem $recursionRoot = null ): array { $assets = []; $recursionRoot = $recursionRoot ?? $asset; diff --git a/libraries/src/WebAsset/WebAssetRegistry.php b/libraries/src/WebAsset/WebAssetRegistry.php index 91d361b930188..c0dfa2d4aeda1 100644 --- a/libraries/src/WebAsset/WebAssetRegistry.php +++ b/libraries/src/WebAsset/WebAssetRegistry.php @@ -222,11 +222,11 @@ public function exists(string $type, string $name): bool /** * Prepare new Asset instance. * - * @param string $name The asset name - * @param string $uri The URI for the asset - * @param array $options Additional options for the asset - * @param array $attributes Attributes for the asset - * @param array $dependencies Asset dependencies + * @param string $name The asset name + * @param ?string $uri The URI for the asset + * @param array $options Additional options for the asset + * @param array $attributes Attributes for the asset + * @param array $dependencies Asset dependencies * * @return WebAssetItem * @@ -234,7 +234,7 @@ public function exists(string $type, string $name): bool */ public function createAsset( string $name, - string $uri = null, + ?string $uri = null, array $options = [], array $attributes = [], array $dependencies = [] diff --git a/libraries/src/Workflow/WorkflowPluginTrait.php b/libraries/src/Workflow/WorkflowPluginTrait.php index 8171660d91755..6accd4391a7ec 100644 --- a/libraries/src/Workflow/WorkflowPluginTrait.php +++ b/libraries/src/Workflow/WorkflowPluginTrait.php @@ -59,13 +59,13 @@ protected function enhanceWorkflowTransitionForm(Form $form, $data) /** * Get the workflow for a given ID * - * @param int|null $workflowId ID of the workflow + * @param ?int $workflowId ID of the workflow * * @return \stdClass|boolean Object on success, false on failure. * * @since 4.0.0 */ - protected function getWorkflow(int $workflowId = null) + protected function getWorkflow(?int $workflowId = null) { $app = $this->getApplication() ?? $this->app; $workflowId = !empty($workflowId) ? $workflowId : $app->getInput()->getInt('workflow_id'); From 7853f425259cf69c07700d37b670a0e693ccb482 Mon Sep 17 00:00:00 2001 From: Christian Heel <66922325+heelc29@users.noreply.github.com> Date: Sat, 20 Apr 2024 20:43:56 +0200 Subject: [PATCH 7/9] plugins --- .../privacy/consents/src/Extension/Consents.php | 2 +- plugins/privacy/contact/src/Extension/Contact.php | 2 +- plugins/privacy/content/src/Extension/Content.php | 2 +- plugins/privacy/message/src/Extension/Message.php | 2 +- plugins/system/webauthn/src/Authentication.php | 14 +++++++------- .../system/webauthn/src/CredentialRepository.php | 4 ++-- plugins/system/webauthn/src/Extension/Webauthn.php | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/plugins/privacy/consents/src/Extension/Consents.php b/plugins/privacy/consents/src/Extension/Consents.php index 8cbf133eead33..eb6bdda115b32 100644 --- a/plugins/privacy/consents/src/Extension/Consents.php +++ b/plugins/privacy/consents/src/Extension/Consents.php @@ -38,7 +38,7 @@ final class Consents extends PrivacyPlugin * * @since 3.9.0 */ - public function onPrivacyExportRequest(RequestTable $request, User $user = null) + public function onPrivacyExportRequest(RequestTable $request, ?User $user = null) { if (!$user) { return []; diff --git a/plugins/privacy/contact/src/Extension/Contact.php b/plugins/privacy/contact/src/Extension/Contact.php index 8f87bb5eb2022..b568687973536 100644 --- a/plugins/privacy/contact/src/Extension/Contact.php +++ b/plugins/privacy/contact/src/Extension/Contact.php @@ -40,7 +40,7 @@ final class Contact extends PrivacyPlugin * * @since 3.9.0 */ - public function onPrivacyExportRequest(RequestTable $request, User $user = null) + public function onPrivacyExportRequest(RequestTable $request, ?User $user = null) { if (!$user && !$request->email) { return []; diff --git a/plugins/privacy/content/src/Extension/Content.php b/plugins/privacy/content/src/Extension/Content.php index ec5615b26491c..49277e7449529 100644 --- a/plugins/privacy/content/src/Extension/Content.php +++ b/plugins/privacy/content/src/Extension/Content.php @@ -39,7 +39,7 @@ final class Content extends PrivacyPlugin * * @since 3.9.0 */ - public function onPrivacyExportRequest(RequestTable $request, User $user = null) + public function onPrivacyExportRequest(RequestTable $request, ?User $user = null) { if (!$user) { return []; diff --git a/plugins/privacy/message/src/Extension/Message.php b/plugins/privacy/message/src/Extension/Message.php index e123260108d6f..98963baf57d74 100644 --- a/plugins/privacy/message/src/Extension/Message.php +++ b/plugins/privacy/message/src/Extension/Message.php @@ -38,7 +38,7 @@ final class Message extends PrivacyPlugin * * @since 3.9.0 */ - public function onPrivacyExportRequest(RequestTable $request, User $user = null) + public function onPrivacyExportRequest(RequestTable $request, ?User $user = null) { if (!$user) { return []; diff --git a/plugins/system/webauthn/src/Authentication.php b/plugins/system/webauthn/src/Authentication.php index ca346706215d9..240b5c46bab35 100644 --- a/plugins/system/webauthn/src/Authentication.php +++ b/plugins/system/webauthn/src/Authentication.php @@ -87,17 +87,17 @@ final class Authentication /** * Public constructor. * - * @param ApplicationInterface|null $app The app we are running in - * @param SessionInterface|null $session The app session object - * @param PublicKeyCredentialSourceRepository|null $credRepo Credentials repo - * @param MetadataStatementRepository|null $mdsRepo Authenticator metadata repo + * @param ?ApplicationInterface $app The app we are running in + * @param ?SessionInterface $session The app session object + * @param ?PublicKeyCredentialSourceRepository $credRepo Credentials repo + * @param ?MetadataStatementRepository $mdsRepo Authenticator metadata repo * * @since 4.2.0 */ public function __construct( - ApplicationInterface $app = null, - SessionInterface $session = null, - PublicKeyCredentialSourceRepository $credRepo = null, + ?ApplicationInterface $app = null, + ?SessionInterface $session = null, + ?PublicKeyCredentialSourceRepository $credRepo = null, ?MetadataStatementRepository $mdsRepo = null ) { $this->app = $app; diff --git a/plugins/system/webauthn/src/CredentialRepository.php b/plugins/system/webauthn/src/CredentialRepository.php index eef333de8084a..6e20e2822c111 100644 --- a/plugins/system/webauthn/src/CredentialRepository.php +++ b/plugins/system/webauthn/src/CredentialRepository.php @@ -40,11 +40,11 @@ final class CredentialRepository implements PublicKeyCredentialSourceRepository, /** * Public constructor. * - * @param DatabaseInterface|null $db The database driver object to use for persistence. + * @param ?DatabaseInterface $db The database driver object to use for persistence. * * @since 4.2.0 */ - public function __construct(DatabaseInterface $db = null) + public function __construct(?DatabaseInterface $db = null) { $this->setDatabase($db); } diff --git a/plugins/system/webauthn/src/Extension/Webauthn.php b/plugins/system/webauthn/src/Extension/Webauthn.php index 026ece9f8aef0..876e04cd48971 100644 --- a/plugins/system/webauthn/src/Extension/Webauthn.php +++ b/plugins/system/webauthn/src/Extension/Webauthn.php @@ -101,11 +101,11 @@ final class Webauthn extends CMSPlugin implements SubscriberInterface * settings. Recognized key values include 'name', * 'group', 'params', 'language (this list is not meant * to be comprehensive). - * @param Authentication|null $authHelper The WebAuthn helper object + * @param ?Authentication $authHelper The WebAuthn helper object * * @since 4.0.0 */ - public function __construct(DispatcherInterface $dispatcher, array $config = [], Authentication $authHelper = null) + public function __construct(DispatcherInterface $dispatcher, array $config = [], ?Authentication $authHelper = null) { parent::__construct($dispatcher, $config); From 66e8d96fa95af575e9c45974b30e384ea145d191 Mon Sep 17 00:00:00 2001 From: Christian Heel <66922325+heelc29@users.noreply.github.com> Date: Sat, 20 Apr 2024 20:47:11 +0200 Subject: [PATCH 8/9] tests --- tests/Unit/Libraries/Cms/Mail/MailerFactoryAwareTraitTest.php | 2 +- tests/Unit/Libraries/Cms/Plugin/CMSPluginTest.php | 2 +- tests/Unit/Plugin/Authentication/Ldap/LdapPluginTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Unit/Libraries/Cms/Mail/MailerFactoryAwareTraitTest.php b/tests/Unit/Libraries/Cms/Mail/MailerFactoryAwareTraitTest.php index a802b5205b165..f736b22bcb87b 100644 --- a/tests/Unit/Libraries/Cms/Mail/MailerFactoryAwareTraitTest.php +++ b/tests/Unit/Libraries/Cms/Mail/MailerFactoryAwareTraitTest.php @@ -35,7 +35,7 @@ class MailerFactoryAwareTraitTest extends UnitTestCase public function testGetSetMailerFactory() { $mailerFactory = new class () implements MailerFactoryInterface { - public function createMailer(Registry $configuration = null): MailerInterface + public function createMailer(?Registry $configuration = null): MailerInterface { return new class () implements MailerInterface { public function send() diff --git a/tests/Unit/Libraries/Cms/Plugin/CMSPluginTest.php b/tests/Unit/Libraries/Cms/Plugin/CMSPluginTest.php index 46a27cbfed951..44ad0633a1614 100644 --- a/tests/Unit/Libraries/Cms/Plugin/CMSPluginTest.php +++ b/tests/Unit/Libraries/Cms/Plugin/CMSPluginTest.php @@ -378,7 +378,7 @@ public function testRegisterListenersNullable() $dispatcher = new Dispatcher(); $plugin = new class ($dispatcher, []) extends CMSPlugin { - public function onTest(\stdClass $event = null) + public function onTest(?\stdClass $event = null) { } }; diff --git a/tests/Unit/Plugin/Authentication/Ldap/LdapPluginTest.php b/tests/Unit/Plugin/Authentication/Ldap/LdapPluginTest.php index 457b17e3f8746..a861f7cf84153 100644 --- a/tests/Unit/Plugin/Authentication/Ldap/LdapPluginTest.php +++ b/tests/Unit/Plugin/Authentication/Ldap/LdapPluginTest.php @@ -335,7 +335,7 @@ public function __construct(bool $failBind, bool $failQuery, bool $hasEntry) $this->hasEntry = $hasEntry; } - public function bind(string $dn = null, string $password = null) + public function bind(?string $dn = null, ?string $password = null) { if ($this->failBind) { throw new LdapException(); From 2857f207de1d798f72894145de65908062579e0c Mon Sep 17 00:00:00 2001 From: Christian Heel <66922325+heelc29@users.noreply.github.com> Date: Sat, 20 Apr 2024 21:06:18 +0200 Subject: [PATCH 9/9] phpdoc --- .../com_content/src/Extension/ContentComponent.php | 4 ++-- .../com_installer/src/Helper/InstallerHelper.php | 8 ++++---- .../components/com_users/src/Model/CaptiveModel.php | 2 +- .../components/com_users/src/Model/MethodsModel.php | 2 +- components/com_tags/src/Service/Router.php | 8 ++++---- libraries/src/Application/IdentityAware.php | 2 +- libraries/src/Document/PreloadManager.php | 2 +- libraries/src/Extension/Module.php | 2 +- libraries/src/HTML/Helpers/ListHelper.php | 2 +- libraries/src/Table/Table.php | 8 ++++---- libraries/src/Workflow/WorkflowServiceInterface.php | 4 ++-- plugins/user/token/src/Extension/Token.php | 8 ++++---- 12 files changed, 26 insertions(+), 26 deletions(-) diff --git a/administrator/components/com_content/src/Extension/ContentComponent.php b/administrator/components/com_content/src/Extension/ContentComponent.php index 745bbc2be3955..bd2861e1fa467 100644 --- a/administrator/components/com_content/src/Extension/ContentComponent.php +++ b/administrator/components/com_content/src/Extension/ContentComponent.php @@ -225,7 +225,7 @@ public function getWorkflowContexts(): array /** * Returns the workflow context based on the given category section * - * @param string $section The section + * @param ?string $section The section * * @return string|null * @@ -255,7 +255,7 @@ protected function getTableNameForSection(?string $section = null) /** * Returns a table name for the state association * - * @param string $section An optional section to separate different areas in the component + * @param ?string $section An optional section to separate different areas in the component * * @return string * diff --git a/administrator/components/com_installer/src/Helper/InstallerHelper.php b/administrator/components/com_installer/src/Helper/InstallerHelper.php index ef6d3c72e04c5..f0899df2e4045 100644 --- a/administrator/components/com_installer/src/Helper/InstallerHelper.php +++ b/administrator/components/com_installer/src/Helper/InstallerHelper.php @@ -178,10 +178,10 @@ function (object $entry): int { /** * Get a list of filter options for the application statuses. * - * @param string $element element of an extension - * @param string $type type of an extension - * @param integer $clientId client_id of an extension - * @param string $folder folder of an extension + * @param string $element element of an extension + * @param string $type type of an extension + * @param integer $clientId client_id of an extension + * @param ?string $folder folder of an extension * * @return \SimpleXMLElement * diff --git a/administrator/components/com_users/src/Model/CaptiveModel.php b/administrator/components/com_users/src/Model/CaptiveModel.php index 074abd33bffbe..9cbe58c36790e 100644 --- a/administrator/components/com_users/src/Model/CaptiveModel.php +++ b/administrator/components/com_users/src/Model/CaptiveModel.php @@ -202,7 +202,7 @@ public function getRecord(?User $user = null): ?MfaTable /** * Load the Captive login page render options for a specific MFA record * - * @param MfaTable $record The MFA record to process + * @param ?MfaTable $record The MFA record to process * * @return CaptiveRenderOptions The rendering options * @since 4.2.0 diff --git a/administrator/components/com_users/src/Model/MethodsModel.php b/administrator/components/com_users/src/Model/MethodsModel.php index 31a2be2a74e2a..ba0d086118f65 100644 --- a/administrator/components/com_users/src/Model/MethodsModel.php +++ b/administrator/components/com_users/src/Model/MethodsModel.php @@ -110,7 +110,7 @@ public function deleteAll(?User $user = null): void * Today, 08:33 * January 1, 2015 * - * @param string $dateTimeText The database time string to use, e.g. "2017-01-13 13:25:36" + * @param ?string $dateTimeText The database time string to use, e.g. "2017-01-13 13:25:36" * * @return string The formatted, human-readable date * @throws \Exception diff --git a/components/com_tags/src/Service/Router.php b/components/com_tags/src/Service/Router.php index 60761bcc834ea..d974896988c91 100644 --- a/components/com_tags/src/Service/Router.php +++ b/components/com_tags/src/Service/Router.php @@ -50,10 +50,10 @@ class Router extends RouterBase /** * Tags Component router constructor * - * @param SiteApplication $app The application object - * @param AbstractMenu $menu The menu object to work with - * @param CategoryFactoryInterface $categoryFactory The category object - * @param DatabaseInterface $db The database object + * @param SiteApplication $app The application object + * @param AbstractMenu $menu The menu object to work with + * @param ?CategoryFactoryInterface $categoryFactory The category object + * @param DatabaseInterface $db The database object * * @since 4.0.0 */ diff --git a/libraries/src/Application/IdentityAware.php b/libraries/src/Application/IdentityAware.php index 4c6c4dab9f557..2be4ac9c99297 100644 --- a/libraries/src/Application/IdentityAware.php +++ b/libraries/src/Application/IdentityAware.php @@ -48,7 +48,7 @@ public function getIdentity() /** * Allows the application to load a custom or default identity. * - * @param User $identity An optional identity object. If omitted, a null user object is created. + * @param ?User $identity An optional identity object. If omitted, a null user object is created. * * @return $this * diff --git a/libraries/src/Document/PreloadManager.php b/libraries/src/Document/PreloadManager.php index a8ce78bc5bb69..8ef2ca57f64fa 100644 --- a/libraries/src/Document/PreloadManager.php +++ b/libraries/src/Document/PreloadManager.php @@ -35,7 +35,7 @@ class PreloadManager implements PreloadManagerInterface /** * PreloadManager constructor * - * @param EvolvableLinkProviderInterface $linkProvider The link provider + * @param ?EvolvableLinkProviderInterface $linkProvider The link provider * * @since 4.0.0 */ diff --git a/libraries/src/Extension/Module.php b/libraries/src/Extension/Module.php index c925ee82043d9..1daec3d6884ab 100644 --- a/libraries/src/Extension/Module.php +++ b/libraries/src/Extension/Module.php @@ -49,7 +49,7 @@ class Module implements ModuleInterface, HelperFactoryInterface * Module constructor. * * @param ModuleDispatcherFactoryInterface $dispatcherFactory The dispatcher factory - * @param HelperFactoryInterface $helperFactory The helper factory + * @param ?HelperFactoryInterface $helperFactory The helper factory * * @since 4.0.0 */ diff --git a/libraries/src/HTML/Helpers/ListHelper.php b/libraries/src/HTML/Helpers/ListHelper.php index 637b7078e77a7..21940aa4c1eda 100644 --- a/libraries/src/HTML/Helpers/ListHelper.php +++ b/libraries/src/HTML/Helpers/ListHelper.php @@ -130,7 +130,7 @@ public static function genericordering($query, $chop = 30) * @param string $attribs HTML tag attributes * @param string $selected The selected item * @param integer $neworder 1 if new and first, -1 if new and last, 0 or null if existing item - * @param string $id ID attribute for the resulting element * * @return string HTML markup for the select list * diff --git a/libraries/src/Table/Table.php b/libraries/src/Table/Table.php index f1b6665f02d27..0048e108ab231 100644 --- a/libraries/src/Table/Table.php +++ b/libraries/src/Table/Table.php @@ -160,10 +160,10 @@ abstract class Table extends \stdClass implements TableInterface, DispatcherAwar * be overridden by child classes to explicitly set the table and key fields * for a particular database table. * - * @param string $table Name of the table to model. - * @param mixed $key Name of the primary key field in the table or array of field names that compose the primary key. - * @param DatabaseDriver $db DatabaseDriver object. - * @param DispatcherInterface $dispatcher Event dispatcher for this table + * @param string $table Name of the table to model. + * @param mixed $key Name of the primary key field in the table or array of field names that compose the primary key. + * @param DatabaseDriver $db DatabaseDriver object. + * @param ?DispatcherInterface $dispatcher Event dispatcher for this table * * @since 1.7.0 */ diff --git a/libraries/src/Workflow/WorkflowServiceInterface.php b/libraries/src/Workflow/WorkflowServiceInterface.php index 25b81a1d2444f..00fef57542bb3 100644 --- a/libraries/src/Workflow/WorkflowServiceInterface.php +++ b/libraries/src/Workflow/WorkflowServiceInterface.php @@ -76,7 +76,7 @@ public static function getConditions(string $extension): array; /** * Returns a table name for the state association * - * @param string $section An optional section to differ different areas in the component + * @param ?string $section An optional section to differ different areas in the component * * @return string * @@ -96,7 +96,7 @@ public function getWorkflowContexts(): array; /** * Returns the workflow context based on the given category section * - * @param string $section The section + * @param ?string $section The section * * @return string|null * diff --git a/plugins/user/token/src/Extension/Token.php b/plugins/user/token/src/Extension/Token.php index 80369d4a976ff..3bd8a06dff386 100644 --- a/plugins/user/token/src/Extension/Token.php +++ b/plugins/user/token/src/Extension/Token.php @@ -250,10 +250,10 @@ public function onContentPrepareForm(Form $form, $data): bool /** * Save the Joomla token in the user profile field * - * @param mixed $data The incoming form data - * @param bool $isNew Is this a new user? - * @param bool $result Has Joomla successfully saved the user? - * @param string $error Error string + * @param mixed $data The incoming form data + * @param bool $isNew Is this a new user? + * @param bool $result Has Joomla successfully saved the user? + * @param ?string $error Error string * * @return void * @since 4.0.0