From 50f7fe22159db7369821b7ffd30c66c57fb8d483 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Mon, 5 Aug 2024 11:22:44 +0200 Subject: [PATCH] Remove implicit nullable types --- .php-cs-fixer.dist.php | 20 ++++++++++--------- .../src/Controller/ActionlogsController.php | 2 +- .../src/Model/AssociationsModel.php | 2 +- .../src/Controller/BannersController.php | 2 +- .../src/Extension/BannersComponent.php | 2 +- .../src/Controller/CategoryController.php | 2 +- .../src/Controller/DisplayController.php | 2 +- .../src/Model/CategoriesModel.php | 2 +- .../src/Model/CategoryModel.php | 2 +- .../com_checkin/src/Model/CheckinModel.php | 2 +- .../src/Controller/ApplicationController.php | 2 +- .../src/Controller/ComponentController.php | 2 +- .../src/Controller/ContactsController.php | 2 +- .../src/Extension/ContactComponent.php | 4 ++-- .../src/Controller/ArticleController.php | 2 +- .../src/Controller/ArticlesController.php | 2 +- .../src/Extension/ContentComponent.php | 2 +- .../com_content/src/Model/ArticleModel.php | 2 +- .../src/Model/HistoryModel.php | 2 +- .../src/Controller/FieldController.php | 2 +- .../src/Controller/GroupController.php | 2 +- .../src/Extension/FieldsComponent.php | 2 +- .../com_fields/src/Helper/FieldsHelper.php | 2 +- .../com_fields/src/Model/FieldModel.php | 2 +- .../com_fields/src/Model/FieldsModel.php | 2 +- .../com_fields/src/Model/GroupsModel.php | 2 +- .../com_fields/src/Table/FieldTable.php | 2 +- .../com_fields/src/Table/GroupTable.php | 2 +- .../com_finder/src/Indexer/Helper.php | 2 +- .../com_finder/src/Indexer/Indexer.php | 2 +- .../com_finder/src/Indexer/Query.php | 2 +- .../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 +- .../src/Controller/ManageController.php | 2 +- .../src/Controller/UpdatesitesController.php | 2 +- .../com_installer/src/Model/DatabaseModel.php | 2 +- .../com_installer/src/Model/DiscoverModel.php | 2 +- .../src/Model/InstallerModel.php | 2 +- .../src/Model/LanguagesModel.php | 2 +- .../com_installer/src/Model/ManageModel.php | 2 +- .../com_installer/src/Model/UpdateModel.php | 2 +- .../src/Model/UpdatesitesModel.php | 2 +- .../src/Model/UpdateModel.php | 2 +- .../src/Model/InstalledModel.php | 2 +- .../com_languages/src/Model/LanguageModel.php | 2 +- .../src/Model/LanguagesModel.php | 2 +- .../src/Model/OverridesModel.php | 2 +- .../src/Controller/TemplateController.php | 2 +- .../src/Provider/ProviderManager.php | 2 +- .../src/Controller/ItemsController.php | 2 +- .../com_menus/src/Model/ItemsModel.php | 2 +- .../com_menus/src/Model/MenusModel.php | 2 +- .../com_messages/src/Model/MessagesModel.php | 2 +- .../src/Extension/NewsfeedsComponent.php | 4 ++-- .../src/Model/NewsfeedsModel.php | 2 +- .../com_plugins/src/Model/PluginModel.php | 2 +- .../com_plugins/src/Model/PluginsModel.php | 2 +- .../com_redirect/src/Model/LinksModel.php | 2 +- .../com_scheduler/src/Model/TaskModel.php | 2 +- .../com_scheduler/src/Model/TasksModel.php | 2 +- .../src/Rule/ExecutionRulesRule.php | 2 +- .../com_scheduler/src/Task/Task.php | 2 +- .../com_tags/src/Model/TagsModel.php | 2 +- .../src/Controller/TemplateController.php | 2 +- .../com_templates/src/Model/StyleModel.php | 2 +- .../com_templates/src/Model/StylesModel.php | 2 +- .../src/Model/TemplatesModel.php | 2 +- .../src/Controller/CallbackController.php | 2 +- .../src/Controller/CaptiveController.php | 2 +- .../src/Controller/MethodController.php | 2 +- .../src/Controller/MethodsController.php | 2 +- .../src/Controller/UsersController.php | 2 +- .../com_users/src/Model/BackupcodesModel.php | 6 +++--- .../com_users/src/Model/CaptiveModel.php | 4 ++-- .../com_users/src/Model/DebuggroupModel.php | 2 +- .../com_users/src/Model/DebuguserModel.php | 2 +- .../com_users/src/Model/GroupModel.php | 2 +- .../com_users/src/Model/GroupsModel.php | 2 +- .../com_users/src/Model/LevelsModel.php | 2 +- .../com_users/src/Model/MethodModel.php | 2 +- .../com_users/src/Model/NotesModel.php | 2 +- .../com_users/src/Model/UserModel.php | 2 +- .../com_users/src/Model/UsersModel.php | 2 +- .../com_users/src/Table/MfaTable.php | 2 +- .../src/Controller/DisplayController.php | 2 +- .../src/Controller/StageController.php | 2 +- .../src/Controller/StagesController.php | 2 +- .../src/Controller/TransitionController.php | 2 +- .../src/Controller/TransitionsController.php | 2 +- .../src/Controller/WorkflowController.php | 2 +- .../src/Controller/WorkflowsController.php | 2 +- .../com_workflow/src/Table/StageTable.php | 2 +- .../src/Table/TransitionTable.php | 2 +- .../com_workflow/src/Table/WorkflowTable.php | 2 +- .../src/Helper/QuickIconHelper.php | 2 +- .../src/View/Categories/JsonapiView.php | 2 +- .../src/View/Application/JsonapiView.php | 2 +- .../src/View/Component/JsonapiView.php | 2 +- .../src/View/Contacts/JsonapiView.php | 2 +- .../src/View/Articles/JsonapiView.php | 2 +- .../src/View/Overrides/JsonapiView.php | 2 +- .../src/View/Strings/JsonapiView.php | 2 +- .../com_users/src/View/Users/JsonapiView.php | 2 +- .../src/Controller/ConfigController.php | 2 +- .../src/Controller/ModulesController.php | 2 +- .../src/Controller/TemplatesController.php | 2 +- .../src/Controller/DisplayController.php | 2 +- .../src/Rule/ContactEmailMessageRule.php | 2 +- .../com_contact/src/Rule/ContactEmailRule.php | 2 +- .../src/Rule/ContactEmailSubjectRule.php | 2 +- .../src/Controller/DisplayController.php | 2 +- .../com_content/src/Helper/QueryHelper.php | 4 ++-- .../src/Controller/DisplayController.php | 2 +- .../src/Controller/DisplayController.php | 2 +- .../src/Controller/DisplayController.php | 2 +- .../com_newsfeeds/src/Model/CategoryModel.php | 2 +- components/com_tags/src/Model/TagModel.php | 2 +- .../com_users/src/Model/ProfileModel.php | 2 +- .../com_users/src/Model/RegistrationModel.php | 2 +- .../src/Rule/LoginUniqueFieldRule.php | 2 +- .../src/Rule/LogoutUniqueFieldRule.php | 2 +- .../CliInstallationApplication.php | 2 +- .../Application/InstallationApplication.php | 6 +++--- .../src/Controller/InstallationController.php | 2 +- installation/src/Form/Rule/UsernameRule.php | 2 +- .../src/Model/BaseInstallationModel.php | 2 +- .../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 | 2 +- .../CacheControllerFactoryAwareTrait.php | 2 +- .../Google/HttpBridgePostRequestMethod.php | 2 +- .../src/Categories/CategoryServiceTrait.php | 4 ++-- .../Exception/MissingComponentException.php | 2 +- .../src/Component/Router/RouterFactory.php | 2 +- libraries/src/Date/Date.php | 2 +- .../Dispatcher/ComponentDispatcherFactory.php | 2 +- .../ComponentDispatcherFactoryInterface.php | 2 +- .../Dispatcher/ModuleDispatcherFactory.php | 2 +- .../ModuleDispatcherFactoryInterface.php | 2 +- libraries/src/Document/PreloadManager.php | 2 +- libraries/src/Editor/Editor.php | 2 +- libraries/src/Extension/Module.php | 2 +- libraries/src/Extension/ModuleInterface.php | 2 +- libraries/src/Feed/FeedParser.php | 2 +- libraries/src/Form/Field/CalendarField.php | 2 +- libraries/src/Form/Field/SubformField.php | 2 +- 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/RulesRule.php | 2 +- 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 | 2 +- libraries/src/Http/Http.php | 2 +- libraries/src/Input/Cli.php | 2 +- libraries/src/Input/Cookie.php | 2 +- libraries/src/Input/Files.php | 2 +- libraries/src/Input/Json.php | 2 +- .../src/Installer/InstallerExtension.php | 2 +- 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/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 | 2 +- .../Mail/Exception/MailDisabledException.php | 2 +- libraries/src/Mail/MailTemplate.php | 2 +- libraries/src/Pagination/Pagination.php | 2 +- libraries/src/Pathway/SitePathway.php | 2 +- libraries/src/Plugin/PluginHelper.php | 4 ++-- .../Exception/RouteNotFoundException.php | 2 +- libraries/src/Router/SiteRouter.php | 2 +- libraries/src/Serializer/JoomlaSerializer.php | 2 +- libraries/src/Session/Session.php | 2 +- .../src/Session/Storage/JoomlaStorage.php | 2 +- libraries/src/Table/Category.php | 2 +- libraries/src/Table/Content.php | 2 +- libraries/src/Table/Language.php | 2 +- libraries/src/Table/MenuType.php | 2 +- libraries/src/Table/Module.php | 2 +- libraries/src/Table/Table.php | 4 ++-- libraries/src/Tag/TagServiceTrait.php | 4 ++-- libraries/src/Toolbar/Toolbar.php | 2 +- libraries/src/UCM/UCMBase.php | 6 +++--- libraries/src/UCM/UCMContent.php | 10 +++++----- libraries/src/UCM/UCMType.php | 2 +- .../AssetItem/LangActiveAssetItem.php | 2 +- libraries/src/WebAsset/WebAssetItem.php | 2 +- libraries/src/WebAsset/WebAssetManager.php | 6 +++--- libraries/src/WebAsset/WebAssetRegistry.php | 2 +- .../src/Workflow/WorkflowPluginTrait.php | 2 +- .../actionlogs/src/Extension/Actionlogs.php | 2 +- .../consents/src/Extension/Consents.php | 2 +- .../privacy/contact/src/Extension/Contact.php | 2 +- .../privacy/content/src/Extension/Content.php | 2 +- .../privacy/message/src/Extension/Message.php | 2 +- .../privacy/user/src/Extension/UserPlugin.php | 6 +++--- .../system/webauthn/src/Authentication.php | 6 +++--- .../webauthn/src/CredentialRepository.php | 2 +- .../webauthn/src/Extension/Webauthn.php | 2 +- .../Cms/Mail/MailerFactoryAwareTraitTest.php | 2 +- .../Libraries/Cms/Plugin/CMSPluginTest.php | 2 +- .../Authentication/Ldap/LdapPluginTest.php | 2 +- 245 files changed, 293 insertions(+), 291 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 3896f0b6b6960..0b7b749572a00 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -67,23 +67,25 @@ ->setRules( [ // Basic ruleset is PSR 12 - '@PSR12' => true, + '@PSR12' => true, // Short array syntax - 'array_syntax' => ['syntax' => 'short'], + 'array_syntax' => ['syntax' => 'short'], // Lists should not have a trailing comma like list($foo, $bar,) = ... - 'no_trailing_comma_in_list_call' => true, + 'no_trailing_comma_in_list_call' => 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'], + // Convert (Foo $bar = null) into (?Foo $bar = null) + 'nullable_type_declaration_for_default_null_value' => true ] ) ->setFinder($finder); diff --git a/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php b/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php index 22d6c6999dbfe..d7fe562d80d26 100644 --- a/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php +++ b/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php @@ -47,7 +47,7 @@ class ActionlogsController extends AdminController * * @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 3e3ecc3491208..e72b6d6786ff9 100644 --- a/administrator/components/com_associations/src/Model/AssociationsModel.php +++ b/administrator/components/com_associations/src/Model/AssociationsModel.php @@ -39,7 +39,7 @@ class AssociationsModel 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_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 5e88ca857c273..96c2c1181d82b 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_categories/src/Controller/CategoryController.php b/administrator/components/com_categories/src/Controller/CategoryController.php index e457e1ae9d950..63507f1a2dc55 100644 --- a/administrator/components/com_categories/src/Controller/CategoryController.php +++ b/administrator/components/com_categories/src/Controller/CategoryController.php @@ -50,7 +50,7 @@ class CategoryController extends FormController * @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 8481ded0815ac..0f45f1969730a 100644 --- a/administrator/components/com_categories/src/Controller/DisplayController.php +++ b/administrator/components/com_categories/src/Controller/DisplayController.php @@ -54,7 +54,7 @@ class DisplayController extends BaseController * * @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 eb50ff1382fa5..16b15f1e347de 100644 --- a/administrator/components/com_categories/src/Model/CategoriesModel.php +++ b/administrator/components/com_categories/src/Model/CategoriesModel.php @@ -47,7 +47,7 @@ class CategoriesModel extends 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_categories/src/Model/CategoryModel.php b/administrator/components/com_categories/src/Model/CategoryModel.php index a340ecb2af2e8..78b1781855da4 100644 --- a/administrator/components/com_categories/src/Model/CategoryModel.php +++ b/administrator/components/com_categories/src/Model/CategoryModel.php @@ -87,7 +87,7 @@ class CategoryModel 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) { $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 ad415724ad659..7d1aeafece402 100644 --- a/administrator/components/com_checkin/src/Model/CheckinModel.php +++ b/administrator/components/com_checkin/src/Model/CheckinModel.php @@ -41,7 +41,7 @@ class CheckinModel 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_config/src/Controller/ApplicationController.php b/administrator/components/com_config/src/Controller/ApplicationController.php index 218f71620b2d1..a58750d3c91a8 100644 --- a/administrator/components/com_config/src/Controller/ApplicationController.php +++ b/administrator/components/com_config/src/Controller/ApplicationController.php @@ -42,7 +42,7 @@ class ApplicationController extends BaseController * * @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..fb5ed0f9c0c7e 100644 --- a/administrator/components/com_config/src/Controller/ComponentController.php +++ b/administrator/components/com_config/src/Controller/ComponentController.php @@ -41,7 +41,7 @@ class ComponentController extends FormController * * @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 2ac3c85d0bf4c..0d98980f44809 100644 --- a/administrator/components/com_contact/src/Controller/ContactsController.php +++ b/administrator/components/com_contact/src/Controller/ContactsController.php @@ -41,7 +41,7 @@ class ContactsController 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_contact/src/Extension/ContactComponent.php b/administrator/components/com_contact/src/Extension/ContactComponent.php index 303ad03e9e254..672286bde1114 100644 --- a/administrator/components/com_contact/src/Extension/ContactComponent.php +++ b/administrator/components/com_contact/src/Extension/ContactComponent.php @@ -134,7 +134,7 @@ public function getContexts(): array * * @since 4.0.0 */ - protected function getTableNameForSection(string $section = null) + protected function getTableNameForSection(?string $section = null) { return ($section === 'category' ? 'categories' : 'contact_details'); } @@ -148,7 +148,7 @@ protected function getTableNameForSection(string $section = 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_content/src/Controller/ArticleController.php b/administrator/components/com_content/src/Controller/ArticleController.php index 32d8b6df8c440..80776a7d636af 100644 --- a/administrator/components/com_content/src/Controller/ArticleController.php +++ b/administrator/components/com_content/src/Controller/ArticleController.php @@ -44,7 +44,7 @@ class ArticleController extends FormController * * @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 55195d1ef86c0..a438ca38e8a8e 100644 --- a/administrator/components/com_content/src/Controller/ArticlesController.php +++ b/administrator/components/com_content/src/Controller/ArticlesController.php @@ -42,7 +42,7 @@ class ArticlesController 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_content/src/Extension/ContentComponent.php b/administrator/components/com_content/src/Extension/ContentComponent.php index 824ae7487fed6..7488a13f94522 100644 --- a/administrator/components/com_content/src/Extension/ContentComponent.php +++ b/administrator/components/com_content/src/Extension/ContentComponent.php @@ -223,7 +223,7 @@ public function getCategoryWorkflowContext(?string $section = null): string * * @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 b88f6f94654c9..831e2fee4cf4d 100644 --- a/administrator/components/com_content/src/Model/ArticleModel.php +++ b/administrator/components/com_content/src/Model/ArticleModel.php @@ -103,7 +103,7 @@ class ArticleModel extends AdminModel implements WorkflowModelInterface * @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_contenthistory/src/Model/HistoryModel.php b/administrator/components/com_contenthistory/src/Model/HistoryModel.php index 71a93c5a31c33..8cc93a770fa69 100644 --- a/administrator/components/com_contenthistory/src/Model/HistoryModel.php +++ b/administrator/components/com_contenthistory/src/Model/HistoryModel.php @@ -43,7 +43,7 @@ class HistoryModel 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_fields/src/Controller/FieldController.php b/administrator/components/com_fields/src/Controller/FieldController.php index 7e7e733a6b0c0..2e49b7e4a3345 100644 --- a/administrator/components/com_fields/src/Controller/FieldController.php +++ b/administrator/components/com_fields/src/Controller/FieldController.php @@ -60,7 +60,7 @@ class FieldController extends FormController * * @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 7aba400b07271..ff1ecb8e4ac67 100644 --- a/administrator/components/com_fields/src/Controller/GroupController.php +++ b/administrator/components/com_fields/src/Controller/GroupController.php @@ -58,7 +58,7 @@ class GroupController extends FormController * * @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 5027972e40304..93e08b5e77c8e 100644 --- a/administrator/components/com_fields/src/Extension/FieldsComponent.php +++ b/administrator/components/com_fields/src/Extension/FieldsComponent.php @@ -36,7 +36,7 @@ class FieldsComponent extends MVCComponent implements CategoryServiceInterface * * @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 7dcd49e4d65e7..900350e7dca01 100644 --- a/administrator/components/com_fields/src/Helper/FieldsHelper.php +++ b/administrator/components/com_fields/src/Helper/FieldsHelper.php @@ -107,7 +107,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 f274213ac52b2..e48d0b8667310 100644 --- a/administrator/components/com_fields/src/Model/FieldModel.php +++ b/administrator/components/com_fields/src/Model/FieldModel.php @@ -91,7 +91,7 @@ class FieldModel extends AdminModel * @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 0d7fe853e97a9..f853089e55cd0 100644 --- a/administrator/components/com_fields/src/Model/FieldsModel.php +++ b/administrator/components/com_fields/src/Model/FieldsModel.php @@ -40,7 +40,7 @@ class FieldsModel extends ListModel * @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 5276c51815d80..b216fd9682af6 100644 --- a/administrator/components/com_fields/src/Model/GroupsModel.php +++ b/administrator/components/com_fields/src/Model/GroupsModel.php @@ -45,7 +45,7 @@ class GroupsModel extends ListModel * @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 eb409dc4b45d0..4bdecc7cb02a3 100644 --- a/administrator/components/com_fields/src/Table/FieldTable.php +++ b/administrator/components/com_fields/src/Table/FieldTable.php @@ -259,7 +259,7 @@ protected function _getAssetTitle() * * @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 8658dd80621c4..40a0428a7a785 100644 --- a/administrator/components/com_fields/src/Table/GroupTable.php +++ b/administrator/components/com_fields/src/Table/GroupTable.php @@ -194,7 +194,7 @@ protected function _getAssetTitle() * * @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 2128627650cc7..3682c5c4c124a 100644 --- a/administrator/components/com_finder/src/Indexer/Helper.php +++ b/administrator/components/com_finder/src/Indexer/Helper.php @@ -403,7 +403,7 @@ public static function getContentExtras(Result $item) * * @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 2cda31615fe11..b9391e46af48b 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 3325fae12ef22..62864c743471e 100644 --- a/administrator/components/com_finder/src/Indexer/Query.php +++ b/administrator/components/com_finder/src/Indexer/Query.php @@ -204,7 +204,7 @@ class Query * @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 1bd47888c8279..17a0a6e30fd8e 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 04a4843f8c7cf..a054347037fa1 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 10dd1b9a9d9c8..f9216c05ea150 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_installer/src/Controller/ManageController.php b/administrator/components/com_installer/src/Controller/ManageController.php index f8deeb148a2e3..fb3b20ad09c5e 100644 --- a/administrator/components/com_installer/src/Controller/ManageController.php +++ b/administrator/components/com_installer/src/Controller/ManageController.php @@ -41,7 +41,7 @@ class ManageController extends BaseController * * @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 141d7b9f942e6..f1a7e4a690c79 100644 --- a/administrator/components/com_installer/src/Controller/UpdatesitesController.php +++ b/administrator/components/com_installer/src/Controller/UpdatesitesController.php @@ -49,7 +49,7 @@ class UpdatesitesController extends AdminController * * @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 4d190376e8584..e733149475acb 100644 --- a/administrator/components/com_installer/src/Model/DatabaseModel.php +++ b/administrator/components/com_installer/src/Model/DatabaseModel.php @@ -69,7 +69,7 @@ class DatabaseModel extends InstallerModel * @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 5b26d09a604d2..090db80232480 100644 --- a/administrator/components/com_installer/src/Model/DiscoverModel.php +++ b/administrator/components/com_installer/src/Model/DiscoverModel.php @@ -39,7 +39,7 @@ class DiscoverModel extends InstallerModel * @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 791a3bcd0eacf..3890b5d80cf0b 100644 --- a/administrator/components/com_installer/src/Model/InstallerModel.php +++ b/administrator/components/com_installer/src/Model/InstallerModel.php @@ -37,7 +37,7 @@ class InstallerModel extends ListModel * @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 f8b3632abafe7..8986fda2e8905 100644 --- a/administrator/components/com_installer/src/Model/LanguagesModel.php +++ b/administrator/components/com_installer/src/Model/LanguagesModel.php @@ -44,7 +44,7 @@ class LanguagesModel extends ListModel * @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 d6a5932d8ec6c..0a7277a3613cf 100644 --- a/administrator/components/com_installer/src/Model/ManageModel.php +++ b/administrator/components/com_installer/src/Model/ManageModel.php @@ -43,7 +43,7 @@ class ManageModel extends InstallerModel * @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 87df0b865b921..872b4e26d2021 100644 --- a/administrator/components/com_installer/src/Model/UpdateModel.php +++ b/administrator/components/com_installer/src/Model/UpdateModel.php @@ -46,7 +46,7 @@ class UpdateModel extends ListModel * @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 c03dfe20aa32e..e6e66d6096596 100644 --- a/administrator/components/com_installer/src/Model/UpdatesitesModel.php +++ b/administrator/components/com_installer/src/Model/UpdatesitesModel.php @@ -42,7 +42,7 @@ class UpdatesitesModel extends InstallerModel * @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_joomlaupdate/src/Model/UpdateModel.php b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php index cb4ce9f2c2cb7..d9c6b4fd3998e 100644 --- a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php +++ b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php @@ -61,7 +61,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 49335bfa18655..da0962d80e449 100644 --- a/administrator/components/com_languages/src/Model/InstalledModel.php +++ b/administrator/components/com_languages/src/Model/InstalledModel.php @@ -66,7 +66,7 @@ class InstalledModel 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_languages/src/Model/LanguageModel.php b/administrator/components/com_languages/src/Model/LanguageModel.php index 47f7e2369f75c..87e20473e58a5 100644 --- a/administrator/components/com_languages/src/Model/LanguageModel.php +++ b/administrator/components/com_languages/src/Model/LanguageModel.php @@ -41,7 +41,7 @@ class LanguageModel 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_languages/src/Model/LanguagesModel.php b/administrator/components/com_languages/src/Model/LanguagesModel.php index 43949a3d2f2da..9d535e167d645 100644 --- a/administrator/components/com_languages/src/Model/LanguagesModel.php +++ b/administrator/components/com_languages/src/Model/LanguagesModel.php @@ -37,7 +37,7 @@ class LanguagesModel 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_languages/src/Model/OverridesModel.php b/administrator/components/com_languages/src/Model/OverridesModel.php index 613721a741ebc..4bab9326caa50 100644 --- a/administrator/components/com_languages/src/Model/OverridesModel.php +++ b/administrator/components/com_languages/src/Model/OverridesModel.php @@ -37,7 +37,7 @@ class OverridesModel extends ListModel * @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 88d8a570ff295..1906aac85ceba 100644 --- a/administrator/components/com_mails/src/Controller/TemplateController.php +++ b/administrator/components/com_mails/src/Controller/TemplateController.php @@ -43,7 +43,7 @@ class TemplateController extends FormController * @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_media/src/Provider/ProviderManager.php b/administrator/components/com_media/src/Provider/ProviderManager.php index a0602647f519c..438bcbd62c367 100644 --- a/administrator/components/com_media/src/Provider/ProviderManager.php +++ b/administrator/components/com_media/src/Provider/ProviderManager.php @@ -69,7 +69,7 @@ public function registerProvider(ProviderInterface $provider) * * @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 b0900aaf1fc61..9edc7738ae33d 100644 --- a/administrator/components/com_menus/src/Controller/ItemsController.php +++ b/administrator/components/com_menus/src/Controller/ItemsController.php @@ -41,7 +41,7 @@ class ItemsController extends AdminController * * @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 6bf5f79a96a41..327cc67293915 100644 --- a/administrator/components/com_menus/src/Model/ItemsModel.php +++ b/administrator/components/com_menus/src/Model/ItemsModel.php @@ -40,7 +40,7 @@ class ItemsModel 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_menus/src/Model/MenusModel.php b/administrator/components/com_menus/src/Model/MenusModel.php index 08b2a6cce528e..1d196c1550213 100644 --- a/administrator/components/com_menus/src/Model/MenusModel.php +++ b/administrator/components/com_menus/src/Model/MenusModel.php @@ -37,7 +37,7 @@ class MenusModel 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_messages/src/Model/MessagesModel.php b/administrator/components/com_messages/src/Model/MessagesModel.php index 0d2494ce3ead9..906402d874099 100644 --- a/administrator/components/com_messages/src/Model/MessagesModel.php +++ b/administrator/components/com_messages/src/Model/MessagesModel.php @@ -35,7 +35,7 @@ class MessagesModel 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_newsfeeds/src/Extension/NewsfeedsComponent.php b/administrator/components/com_newsfeeds/src/Extension/NewsfeedsComponent.php index 63bd515a131d3..02082f382d243 100644 --- a/administrator/components/com_newsfeeds/src/Extension/NewsfeedsComponent.php +++ b/administrator/components/com_newsfeeds/src/Extension/NewsfeedsComponent.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 $section === 'category' ? 'categories' : 'newsfeeds'; } @@ -89,7 +89,7 @@ protected function getTableNameForSection(string $section = 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..06a59828f336f 100644 --- a/administrator/components/com_newsfeeds/src/Model/NewsfeedsModel.php +++ b/administrator/components/com_newsfeeds/src/Model/NewsfeedsModel.php @@ -38,7 +38,7 @@ class NewsfeedsModel 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_plugins/src/Model/PluginModel.php b/administrator/components/com_plugins/src/Model/PluginModel.php index 1e53c0a1de7a1..a952c61797293 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 d5b4e8f779f86..00c06df16b0f7 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_redirect/src/Model/LinksModel.php b/administrator/components/com_redirect/src/Model/LinksModel.php index 042e4314d84df..82adbd02d7eed 100644 --- a/administrator/components/com_redirect/src/Model/LinksModel.php +++ b/administrator/components/com_redirect/src/Model/LinksModel.php @@ -35,7 +35,7 @@ class LinksModel extends 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_scheduler/src/Model/TaskModel.php b/administrator/components/com_scheduler/src/Model/TaskModel.php index c4d51112c7c2b..b5249a28c3532 100644 --- a/administrator/components/com_scheduler/src/Model/TaskModel.php +++ b/administrator/components/com_scheduler/src/Model/TaskModel.php @@ -116,7 +116,7 @@ class TaskModel extends AdminModel * @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..cad66ce12d99c 100644 --- a/administrator/components/com_scheduler/src/Model/TasksModel.php +++ b/administrator/components/com_scheduler/src/Model/TasksModel.php @@ -46,7 +46,7 @@ class TasksModel extends ListModel * @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/Task/Task.php b/administrator/components/com_scheduler/src/Task/Task.php index f5f0279a7033b..043980cf1ab12 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 eb7c5b289bf9c..6e8511eecc6cf 100644 --- a/administrator/components/com_tags/src/Model/TagsModel.php +++ b/administrator/components/com_tags/src/Model/TagsModel.php @@ -38,7 +38,7 @@ class TagsModel extends 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_templates/src/Controller/TemplateController.php b/administrator/components/com_templates/src/Controller/TemplateController.php index 5195cbc43ca90..81f24c5bcf38d 100644 --- a/administrator/components/com_templates/src/Controller/TemplateController.php +++ b/administrator/components/com_templates/src/Controller/TemplateController.php @@ -44,7 +44,7 @@ class TemplateController extends BaseController * @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 34ba13b8d7e93..a09b54bd9f151 100644 --- a/administrator/components/com_templates/src/Model/StyleModel.php +++ b/administrator/components/com_templates/src/Model/StyleModel.php @@ -71,7 +71,7 @@ class StyleModel 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_templates/src/Model/StylesModel.php b/administrator/components/com_templates/src/Model/StylesModel.php index 61cf1d7379672..4dcbb104e2718 100644 --- a/administrator/components/com_templates/src/Model/StylesModel.php +++ b/administrator/components/com_templates/src/Model/StylesModel.php @@ -37,7 +37,7 @@ class StylesModel 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_templates/src/Model/TemplatesModel.php b/administrator/components/com_templates/src/Model/TemplatesModel.php index 86e157ecdb32d..392cb9696a640 100644 --- a/administrator/components/com_templates/src/Model/TemplatesModel.php +++ b/administrator/components/com_templates/src/Model/TemplatesModel.php @@ -38,7 +38,7 @@ class TemplatesModel 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_users/src/Controller/CallbackController.php b/administrator/components/com_users/src/Controller/CallbackController.php index 0c4253d65c9fc..e32cfa8ee144e 100644 --- a/administrator/components/com_users/src/Controller/CallbackController.php +++ b/administrator/components/com_users/src/Controller/CallbackController.php @@ -39,7 +39,7 @@ class CallbackController extends BaseController * * @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 1870c27cded38..b8f2673d7ed3f 100644 --- a/administrator/components/com_users/src/Controller/CaptiveController.php +++ b/administrator/components/com_users/src/Controller/CaptiveController.php @@ -48,7 +48,7 @@ class CaptiveController extends BaseController implements UserFactoryAwareInterf * * @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 a8a2089fc41b1..d311ba70995ed 100644 --- a/administrator/components/com_users/src/Controller/MethodController.php +++ b/administrator/components/com_users/src/Controller/MethodController.php @@ -51,7 +51,7 @@ class MethodController extends BaseControllerAlias implements UserFactoryAwareIn * * @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 850a558c4e65d..f8ff0ce7813c0 100644 --- a/administrator/components/com_users/src/Controller/MethodsController.php +++ b/administrator/components/com_users/src/Controller/MethodsController.php @@ -46,7 +46,7 @@ class MethodsController extends BaseController implements UserFactoryAwareInterf * * @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 cca64525cd399..38aab6b1189a6 100644 --- a/administrator/components/com_users/src/Controller/UsersController.php +++ b/administrator/components/com_users/src/Controller/UsersController.php @@ -48,7 +48,7 @@ class UsersController extends AdminController * @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 1260666d7e7f1..a968762e1a3a6 100644 --- a/administrator/components/com_users/src/Model/BackupcodesModel.php +++ b/administrator/components/com_users/src/Model/BackupcodesModel.php @@ -45,7 +45,7 @@ class BackupcodesModel extends BaseDatabaseModel * @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)) { @@ -78,7 +78,7 @@ public function getBackupCodesRecord(User $user = null): ?MfaTable * @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)) { @@ -167,7 +167,7 @@ public function saveBackupCodes(array $codes, ?User $user = null): bool * @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)) { diff --git a/administrator/components/com_users/src/Model/CaptiveModel.php b/administrator/components/com_users/src/Model/CaptiveModel.php index 8b5a21e70b22a..18932a03ad7c9 100644 --- a/administrator/components/com_users/src/Model/CaptiveModel.php +++ b/administrator/components/com_users/src/Model/CaptiveModel.php @@ -60,7 +60,7 @@ class CaptiveModel extends BaseDatabaseModel * * @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(); @@ -80,7 +80,7 @@ public function suppressAllModules(CMSApplication $app = null): void * * @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 238930b21364b..42c3c4c7cdf2c 100644 --- a/administrator/components/com_users/src/Model/DebuggroupModel.php +++ b/administrator/components/com_users/src/Model/DebuggroupModel.php @@ -40,7 +40,7 @@ class DebuggroupModel 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_users/src/Model/DebuguserModel.php b/administrator/components/com_users/src/Model/DebuguserModel.php index 04876fe1ca146..590cb99f065eb 100644 --- a/administrator/components/com_users/src/Model/DebuguserModel.php +++ b/administrator/components/com_users/src/Model/DebuguserModel.php @@ -39,7 +39,7 @@ class DebuguserModel 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_users/src/Model/GroupModel.php b/administrator/components/com_users/src/Model/GroupModel.php index 5b3789dfada8e..1046313f1571a 100644 --- a/administrator/components/com_users/src/Model/GroupModel.php +++ b/administrator/components/com_users/src/Model/GroupModel.php @@ -42,7 +42,7 @@ class GroupModel 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_users/src/Model/GroupsModel.php b/administrator/components/com_users/src/Model/GroupsModel.php index a724186f98636..76f3f99b7703c 100644 --- a/administrator/components/com_users/src/Model/GroupsModel.php +++ b/administrator/components/com_users/src/Model/GroupsModel.php @@ -37,7 +37,7 @@ class GroupsModel 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_users/src/Model/LevelsModel.php b/administrator/components/com_users/src/Model/LevelsModel.php index e586665311302..4188163044501 100644 --- a/administrator/components/com_users/src/Model/LevelsModel.php +++ b/administrator/components/com_users/src/Model/LevelsModel.php @@ -39,7 +39,7 @@ class LevelsModel 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_users/src/Model/MethodModel.php b/administrator/components/com_users/src/Model/MethodModel.php index eab67c9f337fa..bc3b11cdfc4e7 100644 --- a/administrator/components/com_users/src/Model/MethodModel.php +++ b/administrator/components/com_users/src/Model/MethodModel.php @@ -126,7 +126,7 @@ public function getRenderOptions(?User $user = null): SetupRenderOptions * * @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..7d59ea0bfa5d5 100644 --- a/administrator/components/com_users/src/Model/NotesModel.php +++ b/administrator/components/com_users/src/Model/NotesModel.php @@ -37,7 +37,7 @@ class NotesModel 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) { // 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 3c339da03c552..7c5cf32c14afb 100644 --- a/administrator/components/com_users/src/Model/UserModel.php +++ b/administrator/components/com_users/src/Model/UserModel.php @@ -52,7 +52,7 @@ class UserModel 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_users/src/Model/UsersModel.php b/administrator/components/com_users/src/Model/UsersModel.php index 0d3c46551726f..e6f94a9757c90 100644 --- a/administrator/components/com_users/src/Model/UsersModel.php +++ b/administrator/components/com_users/src/Model/UsersModel.php @@ -49,7 +49,7 @@ class UsersModel 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_users/src/Table/MfaTable.php b/administrator/components/com_users/src/Table/MfaTable.php index 81c967ca5a51f..bdebb00a58769 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_workflow/src/Controller/DisplayController.php b/administrator/components/com_workflow/src/Controller/DisplayController.php index 297d2cf6c2d32..4a2e64707fb61 100644 --- a/administrator/components/com_workflow/src/Controller/DisplayController.php +++ b/administrator/components/com_workflow/src/Controller/DisplayController.php @@ -64,7 +64,7 @@ class DisplayController extends BaseController * @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..e64d9226a8b88 100644 --- a/administrator/components/com_workflow/src/Controller/StageController.php +++ b/administrator/components/com_workflow/src/Controller/StageController.php @@ -62,7 +62,7 @@ class StageController extends FormController * @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 7e8bf3cc58f46..6bb23e0bb1b5d 100644 --- a/administrator/components/com_workflow/src/Controller/StagesController.php +++ b/administrator/components/com_workflow/src/Controller/StagesController.php @@ -72,7 +72,7 @@ class StagesController extends AdminController * @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..ddf00d21e7662 100644 --- a/administrator/components/com_workflow/src/Controller/TransitionController.php +++ b/administrator/components/com_workflow/src/Controller/TransitionController.php @@ -62,7 +62,7 @@ class TransitionController extends FormController * @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..0bd71caebaaca 100644 --- a/administrator/components/com_workflow/src/Controller/TransitionsController.php +++ b/administrator/components/com_workflow/src/Controller/TransitionsController.php @@ -70,7 +70,7 @@ class TransitionsController extends AdminController * @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..4349d64106737 100644 --- a/administrator/components/com_workflow/src/Controller/WorkflowController.php +++ b/administrator/components/com_workflow/src/Controller/WorkflowController.php @@ -56,7 +56,7 @@ class WorkflowController extends FormController * @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 95a43c92dec4f..721d70d57c5c0 100644 --- a/administrator/components/com_workflow/src/Controller/WorkflowsController.php +++ b/administrator/components/com_workflow/src/Controller/WorkflowsController.php @@ -56,7 +56,7 @@ class WorkflowsController extends AdminController * @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 b7d8eeb6f6577..774898f3828e0 100644 --- a/administrator/components/com_workflow/src/Table/StageTable.php +++ b/administrator/components/com_workflow/src/Table/StageTable.php @@ -254,7 +254,7 @@ protected function _getAssetTitle() * * @since 4.0.0 */ - protected function _getAssetParentId(Table $table = null, $id = null) + protected function _getAssetParentId(?Table $table = null, $id = null) { $asset = self::getInstance('Asset', 'JTable', ['dbo' => $this->getDbo()]); diff --git a/administrator/components/com_workflow/src/Table/TransitionTable.php b/administrator/components/com_workflow/src/Table/TransitionTable.php index 1a43a380d025b..7ae1a612f1d0d 100644 --- a/administrator/components/com_workflow/src/Table/TransitionTable.php +++ b/administrator/components/com_workflow/src/Table/TransitionTable.php @@ -123,7 +123,7 @@ protected function _getAssetTitle() * * @since 4.0.0 */ - protected function _getAssetParentId(Table $table = null, $id = null) + protected function _getAssetParentId(?Table $table = null, $id = null) { $asset = self::getInstance('Asset', 'JTable', ['dbo' => $this->getDbo()]); diff --git a/administrator/components/com_workflow/src/Table/WorkflowTable.php b/administrator/components/com_workflow/src/Table/WorkflowTable.php index 06650b5b34070..ad18ff39678c0 100644 --- a/administrator/components/com_workflow/src/Table/WorkflowTable.php +++ b/administrator/components/com_workflow/src/Table/WorkflowTable.php @@ -285,7 +285,7 @@ protected function _getAssetTitle() * * @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(); diff --git a/api/components/com_categories/src/View/Categories/JsonapiView.php b/api/components/com_categories/src/View/Categories/JsonapiView.php index 360a5ba3f03a2..09b06d5c0db6b 100644 --- a/api/components/com_categories/src/View/Categories/JsonapiView.php +++ b/api/components/com_categories/src/View/Categories/JsonapiView.php @@ -103,7 +103,7 @@ class JsonapiView extends BaseApiView * * @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 c9a762672d80d..947616268e5dc 100644 --- a/api/components/com_config/src/View/Application/JsonapiView.php +++ b/api/components/com_config/src/View/Application/JsonapiView.php @@ -37,7 +37,7 @@ class JsonapiView extends BaseApiView * * @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 0cf690523a6f1..b0f6b648590dc 100644 --- a/api/components/com_config/src/View/Component/JsonapiView.php +++ b/api/components/com_config/src/View/Component/JsonapiView.php @@ -38,7 +38,7 @@ class JsonapiView extends BaseApiView * * @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..3d076de022fc5 100644 --- a/api/components/com_contact/src/View/Contacts/JsonapiView.php +++ b/api/components/com_contact/src/View/Contacts/JsonapiView.php @@ -134,7 +134,7 @@ public function __construct($config = []) * * @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..a14b22cb86185 100644 --- a/api/components/com_content/src/View/Articles/JsonapiView.php +++ b/api/components/com_content/src/View/Articles/JsonapiView.php @@ -144,7 +144,7 @@ public function __construct($config = []) * * @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..03669c7eca182 100644 --- a/api/components/com_languages/src/View/Overrides/JsonapiView.php +++ b/api/components/com_languages/src/View/Overrides/JsonapiView.php @@ -66,7 +66,7 @@ public function displayItem($item = null) * * @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..801688c834d87 100644 --- a/api/components/com_languages/src/View/Strings/JsonapiView.php +++ b/api/components/com_languages/src/View/Strings/JsonapiView.php @@ -48,7 +48,7 @@ class JsonapiView extends BaseApiView * * @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..c34e137a0e7ee 100644 --- a/api/components/com_users/src/View/Users/JsonapiView.php +++ b/api/components/com_users/src/View/Users/JsonapiView.php @@ -75,7 +75,7 @@ class JsonapiView extends BaseApiView * * @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; diff --git a/components/com_config/src/Controller/ConfigController.php b/components/com_config/src/Controller/ConfigController.php index 5866bc0955b44..7ea9639e34fa2 100644 --- a/components/com_config/src/Controller/ConfigController.php +++ b/components/com_config/src/Controller/ConfigController.php @@ -39,7 +39,7 @@ class ConfigController extends BaseController * * @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 8286407824dd4..9686b04a5aadb 100644 --- a/components/com_config/src/Controller/ModulesController.php +++ b/components/com_config/src/Controller/ModulesController.php @@ -43,7 +43,7 @@ class ModulesController extends BaseController * * @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..f16fbe812692a 100644 --- a/components/com_config/src/Controller/TemplatesController.php +++ b/components/com_config/src/Controller/TemplatesController.php @@ -39,7 +39,7 @@ class TemplatesController extends BaseController * * @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 076f65a14061e..cb907b23bfc04 100644 --- a/components/com_contact/src/Controller/DisplayController.php +++ b/components/com_contact/src/Controller/DisplayController.php @@ -36,7 +36,7 @@ class DisplayController extends BaseController * * @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..6dd6c63969c40 100644 --- a/components/com_contact/src/Rule/ContactEmailMessageRule.php +++ b/components/com_contact/src/Rule/ContactEmailMessageRule.php @@ -40,7 +40,7 @@ class ContactEmailMessageRule extends FormRule * * @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..e1de0d542e1c7 100644 --- a/components/com_contact/src/Rule/ContactEmailRule.php +++ b/components/com_contact/src/Rule/ContactEmailRule.php @@ -40,7 +40,7 @@ class ContactEmailRule extends EmailRule * * @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..a5a9f8de7949a 100644 --- a/components/com_contact/src/Rule/ContactEmailSubjectRule.php +++ b/components/com_contact/src/Rule/ContactEmailSubjectRule.php @@ -40,7 +40,7 @@ class ContactEmailSubjectRule extends FormRule * * @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 627fa62534297..8e2bac0a7040d 100644 --- a/components/com_content/src/Controller/DisplayController.php +++ b/components/com_content/src/Controller/DisplayController.php @@ -37,7 +37,7 @@ class DisplayController extends \Joomla\CMS\MVC\Controller\BaseController * * @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..89f53bc35e6fd 100644 --- a/components/com_content/src/Helper/QueryHelper.php +++ b/components/com_content/src/Helper/QueryHelper.php @@ -69,7 +69,7 @@ public static function orderbyPrimary($orderby) * * @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(); @@ -170,7 +170,7 @@ public static function orderbySecondary($orderby, $orderDate = 'created', Databa * * @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..aa76adb41cb7b 100644 --- a/components/com_contenthistory/src/Controller/DisplayController.php +++ b/components/com_contenthistory/src/Controller/DisplayController.php @@ -34,7 +34,7 @@ class DisplayController extends BaseController * * @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..f3c15100b97e9 100644 --- a/components/com_fields/src/Controller/DisplayController.php +++ b/components/com_fields/src/Controller/DisplayController.php @@ -34,7 +34,7 @@ class DisplayController extends \Joomla\CMS\MVC\Controller\BaseController * * @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..a87f216586b0e 100644 --- a/components/com_modules/src/Controller/DisplayController.php +++ b/components/com_modules/src/Controller/DisplayController.php @@ -37,7 +37,7 @@ class DisplayController extends BaseController * * @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 041fb0e205645..5fa350c9bb07a 100644 --- a/components/com_newsfeeds/src/Model/CategoryModel.php +++ b/components/com_newsfeeds/src/Model/CategoryModel.php @@ -90,7 +90,7 @@ class CategoryModel 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/components/com_tags/src/Model/TagModel.php b/components/com_tags/src/Model/TagModel.php index 39d464506daa7..c469670bcbe82 100644 --- a/components/com_tags/src/Model/TagModel.php +++ b/components/com_tags/src/Model/TagModel.php @@ -56,7 +56,7 @@ class TagModel extends 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/components/com_users/src/Model/ProfileModel.php b/components/com_users/src/Model/ProfileModel.php index 12a28607c2106..366cf25660101 100644 --- a/components/com_users/src/Model/ProfileModel.php +++ b/components/com_users/src/Model/ProfileModel.php @@ -52,7 +52,7 @@ class ProfileModel extends FormModel * @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 42c793d8af89c..468acd9327a10 100644 --- a/components/com_users/src/Model/RegistrationModel.php +++ b/components/com_users/src/Model/RegistrationModel.php @@ -57,7 +57,7 @@ class RegistrationModel extends FormModel * @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 2a29e749020b6..627b852626d5f 100644 --- a/components/com_users/src/Rule/LoginUniqueFieldRule.php +++ b/components/com_users/src/Rule/LoginUniqueFieldRule.php @@ -43,7 +43,7 @@ class LoginUniqueFieldRule extends FormRule * * @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 e028c59ef27d9..677c48f31c7a2 100644 --- a/components/com_users/src/Rule/LogoutUniqueFieldRule.php +++ b/components/com_users/src/Rule/LogoutUniqueFieldRule.php @@ -43,7 +43,7 @@ class LogoutUniqueFieldRule extends FormRule * * @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; diff --git a/installation/src/Application/CliInstallationApplication.php b/installation/src/Application/CliInstallationApplication.php index d9dcc5762149d..eb49896cde68e 100644 --- a/installation/src/Application/CliInstallationApplication.php +++ b/installation/src/Application/CliInstallationApplication.php @@ -211,7 +211,7 @@ public function getLocalise() * * @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 2edc8750749f4..7a1ab752a8e5f 100644 --- a/installation/src/Application/InstallationApplication.php +++ b/installation/src/Application/InstallationApplication.php @@ -59,7 +59,7 @@ final class InstallationApplication extends CMSApplication * * @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'; @@ -346,7 +346,7 @@ public function getLocalise() * * @since 3.1 */ - public function getLocaliseAdmin(DatabaseInterface $db = null) + public function getLocaliseAdmin(?DatabaseInterface $db = null) { $langfiles = []; @@ -477,7 +477,7 @@ protected function initialiseApp($options = []) * * @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 beefe02532776..cae113797fad6 100644 --- a/installation/src/Controller/InstallationController.php +++ b/installation/src/Controller/InstallationController.php @@ -37,7 +37,7 @@ class InstallationController extends JSONController * * @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 7442286d988d7..fbad87271ab38 100644 --- a/installation/src/Form/Rule/UsernameRule.php +++ b/installation/src/Form/Rule/UsernameRule.php @@ -38,7 +38,7 @@ class UsernameRule extends FormRule * * @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..7a3b7a8446cf9 100644 --- a/installation/src/Model/BaseInstallationModel.php +++ b/installation/src/Model/BaseInstallationModel.php @@ -33,7 +33,7 @@ class BaseInstallationModel extends BaseDatabaseModel * @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; diff --git a/libraries/src/Application/AdministratorApplication.php b/libraries/src/Application/AdministratorApplication.php index a785b8183b67d..c29f6186f494b 100644 --- a/libraries/src/Application/AdministratorApplication.php +++ b/libraries/src/Application/AdministratorApplication.php @@ -68,7 +68,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 75842eb06d7f4..7cc4fc135f707 100644 --- a/libraries/src/Application/ApiApplication.php +++ b/libraries/src/Application/ApiApplication.php @@ -67,7 +67,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 11080c64d0bdf..c64e8dda7a91c 100644 --- a/libraries/src/Application/BaseApplication.php +++ b/libraries/src/Application/BaseApplication.php @@ -48,7 +48,7 @@ abstract class BaseApplication extends AbstractApplication implements Dispatcher * * @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 de7aaa5c34254..a6efdf4623bf5 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 37df60b8fc8d1..7364ddf35964f 100644 --- a/libraries/src/Application/CMSApplication.php +++ b/libraries/src/Application/CMSApplication.php @@ -167,7 +167,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); @@ -465,7 +465,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 009c07cb72df2..dc2b1bfd703f4 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 6dda7a98c4e34..18ad9fece7a3f 100644 --- a/libraries/src/Application/CliApplication.php +++ b/libraries/src/Application/CliApplication.php @@ -114,12 +114,12 @@ abstract class CliApplication extends AbstractApplication implements DispatcherA * @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 825ee9deceb6f..ff05b0018a700 100644 --- a/libraries/src/Application/DaemonApplication.php +++ b/libraries/src/Application/DaemonApplication.php @@ -112,7 +112,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 f5ca4d69c14e2..e7e9276422ca7 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 5506fe9043c50..2abb5036c8e72 100644 --- a/libraries/src/Application/SiteApplication.php +++ b/libraries/src/Application/SiteApplication.php @@ -81,7 +81,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 3641dec59aaa6..ecba32774028b 100644 --- a/libraries/src/Application/WebApplication.php +++ b/libraries/src/Application/WebApplication.php @@ -98,7 +98,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(); @@ -273,7 +273,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(); @@ -293,7 +293,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(); @@ -316,7 +316,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 1deb76aa4e3f5..8bde6d3fc5ec5 100644 --- a/libraries/src/Authentication/Authentication.php +++ b/libraries/src/Authentication/Authentication.php @@ -99,7 +99,7 @@ class Authentication * * @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..e32a21177363a 100644 --- a/libraries/src/Cache/CacheControllerFactoryAwareTrait.php +++ b/libraries/src/Cache/CacheControllerFactoryAwareTrait.php @@ -61,7 +61,7 @@ protected function getCacheControllerFactory(): CacheControllerFactoryInterface * * @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/Google/HttpBridgePostRequestMethod.php b/libraries/src/Captcha/Google/HttpBridgePostRequestMethod.php index cb134f89e32f1..1e0fa3f476900 100644 --- a/libraries/src/Captcha/Google/HttpBridgePostRequestMethod.php +++ b/libraries/src/Captcha/Google/HttpBridgePostRequestMethod.php @@ -49,7 +49,7 @@ final class HttpBridgePostRequestMethod implements RequestMethod * * @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 bd2b305a7683e..dcb83078804b7 100644 --- a/libraries/src/Categories/CategoryServiceTrait.php +++ b/libraries/src/Categories/CategoryServiceTrait.php @@ -106,7 +106,7 @@ public function prepareForm(Form $form, $data) * * @since 4.0.0 */ - protected function getTableNameForSection(string $section = null) + protected function getTableNameForSection(?string $section = null) { return null; } @@ -120,7 +120,7 @@ protected function getTableNameForSection(string $section = 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/Exception/MissingComponentException.php b/libraries/src/Component/Exception/MissingComponentException.php index 238f00fff2b25..0f4c9d2183b4f 100644 --- a/libraries/src/Component/Exception/MissingComponentException.php +++ b/libraries/src/Component/Exception/MissingComponentException.php @@ -31,7 +31,7 @@ class MissingComponentException extends RouteNotFoundException * * @since 3.7.0 */ - public function __construct($message = '', $code = 404, \Exception $previous = null) + public function __construct($message = '', $code = 404, ?\Exception $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/libraries/src/Component/Router/RouterFactory.php b/libraries/src/Component/Router/RouterFactory.php index bf8fa9bcbabd2..168e1b0fc82fe 100644 --- a/libraries/src/Component/Router/RouterFactory.php +++ b/libraries/src/Component/Router/RouterFactory.php @@ -61,7 +61,7 @@ class RouterFactory implements RouterFactoryInterface * * @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 f6eb237b70fb8..b54967d2dcf54 100644 --- a/libraries/src/Date/Date.php +++ b/libraries/src/Date/Date.php @@ -434,7 +434,7 @@ public function toISO8601($local = false) * @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..8ddd25aa1c51c 100644 --- a/libraries/src/Dispatcher/ComponentDispatcherFactory.php +++ b/libraries/src/Dispatcher/ComponentDispatcherFactory.php @@ -66,7 +66,7 @@ public function __construct(string $namespace, MVCFactoryInterface $mvcFactory) * * @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..87833b29cb21e 100644 --- a/libraries/src/Dispatcher/ComponentDispatcherFactoryInterface.php +++ b/libraries/src/Dispatcher/ComponentDispatcherFactoryInterface.php @@ -33,5 +33,5 @@ interface ComponentDispatcherFactoryInterface * * @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..99ef41dea7ce0 100644 --- a/libraries/src/Dispatcher/ModuleDispatcherFactory.php +++ b/libraries/src/Dispatcher/ModuleDispatcherFactory.php @@ -55,7 +55,7 @@ public function __construct(string $namespace) * * @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..b80242518ca1b 100644 --- a/libraries/src/Dispatcher/ModuleDispatcherFactoryInterface.php +++ b/libraries/src/Dispatcher/ModuleDispatcherFactoryInterface.php @@ -34,5 +34,5 @@ interface ModuleDispatcherFactoryInterface * * @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/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 d2960279de701..0f8f28df0a4b7 100644 --- a/libraries/src/Editor/Editor.php +++ b/libraries/src/Editor/Editor.php @@ -78,7 +78,7 @@ class Editor implements DispatcherAwareInterface * @param string $editor The editor name * @param DispatcherInterface $dispatcher The event dispatcher we're going to use */ - public function __construct($editor = 'none', DispatcherInterface $dispatcher = null) + public function __construct($editor = 'none', ?DispatcherInterface $dispatcher = null) { $this->_name = $editor; diff --git a/libraries/src/Extension/Module.php b/libraries/src/Extension/Module.php index de2db49bd5530..2731059b90276 100644 --- a/libraries/src/Extension/Module.php +++ b/libraries/src/Extension/Module.php @@ -70,7 +70,7 @@ public function __construct(ModuleDispatcherFactoryInterface $dispatcherFactory, * * @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 9fb0adf09ce21..5b6ee7829de5c 100644 --- a/libraries/src/Extension/ModuleInterface.php +++ b/libraries/src/Extension/ModuleInterface.php @@ -35,5 +35,5 @@ interface ModuleInterface * * @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 2076fe287f5e5..5fcf89fadb70a 100644 --- a/libraries/src/Feed/FeedParser.php +++ b/libraries/src/Feed/FeedParser.php @@ -63,7 +63,7 @@ abstract class FeedParser * * @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 e5c39969e5403..4b6db4223ec91 100644 --- a/libraries/src/Form/Field/CalendarField.php +++ b/libraries/src/Form/Field/CalendarField.php @@ -386,7 +386,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 0a59a5eef2361..a7827c42c56cb 100644 --- a/libraries/src/Form/Field/SubformField.php +++ b/libraries/src/Form/Field/SubformField.php @@ -407,7 +407,7 @@ protected function loadSubFormData(Form $subForm) * @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 554dfff9d0c4c..c1d82289c7b7f 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 98489afd3c748..9264a09d381aa 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 1b91907714597..54c04961d64dc 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 dfb0620ac3a6f..8f080035dd6dc 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 f08fbd6a8bd7f..a53b032bbff38 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 ff9571602f131..e73320fdd8f80 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 2ec5e789b42e0..4848ff15ca8f8 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 e724b4fb9390c..5270dcb0fb65c 100644 --- a/libraries/src/Form/FormField.php +++ b/libraries/src/Form/FormField.php @@ -1062,7 +1062,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)) { @@ -1142,7 +1142,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)) { @@ -1251,7 +1251,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 1e3e1126fff27..630e3a62cb366 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 bf12c43fe8e98..e30c0f006e102 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 19c5ec1095295..0d4d923b01432 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 fa5f9c563de0a..52b21754f9232 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 d5f43729ada15..494a2fa9f2b61 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 b84419cb56368..69824f34f950d 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 abc8a65531694..b279d486084d8 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 b33f5f7461ec4..7008925fd17b4 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 4c8160f61ca98..b346a9a1bed22 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 4a67d51511ee2..e6e86db68f0a5 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 3dc72553a374f..90b295e750f08 100644 --- a/libraries/src/Form/Rule/FolderPathExistsRule.php +++ b/libraries/src/Form/Rule/FolderPathExistsRule.php @@ -40,7 +40,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 3f41631fcc972..0bc777587b819 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 78cc42992a7f9..cd8c1ddb55132 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 2df79b8f42cbb..46e9c89209508 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 f6f38c2ab4098..adf4589cfe088 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/RulesRule.php b/libraries/src/Form/Rule/RulesRule.php index 050c050c63385..b0b4dcbf1a7e8 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/SubformRule.php b/libraries/src/Form/Rule/SubformRule.php index 2749952de71f5..d7246953b41fb 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 94285e7f1da66..283e3c165f2a7 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 45be717e8fbe8..0abc2083cf617 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 0325b75622223..92297710ece76 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 867b55b7d1fd8..015ab1c68c196 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 5580933eb32d6..a5a9b320c79f4 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..c0bc1ee2693b9 100644 --- a/libraries/src/HTML/HTMLRegistryAwareTrait.php +++ b/libraries/src/HTML/HTMLRegistryAwareTrait.php @@ -54,7 +54,7 @@ public function getRegistry() * * @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 76a736179c7da..e8b8fba9901c9 100644 --- a/libraries/src/Http/Http.php +++ b/libraries/src/Http/Http.php @@ -33,7 +33,7 @@ class Http extends FrameworkHttp * @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 10eb07cf624bc..dbd266a40e7e2 100644 --- a/libraries/src/Input/Cli.php +++ b/libraries/src/Input/Cli.php @@ -59,7 +59,7 @@ class Cli extends Input * @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 fb9ce79c95580..ced34e070d977 100644 --- a/libraries/src/Input/Cookie.php +++ b/libraries/src/Input/Cookie.php @@ -36,7 +36,7 @@ class Cookie extends Input * @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 16a18686d155b..f194564c66d16 100644 --- a/libraries/src/Input/Files.php +++ b/libraries/src/Input/Files.php @@ -48,7 +48,7 @@ class Files extends Input * @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 9ae665d27fdf0..3feb2a9be423e 100644 --- a/libraries/src/Input/Json.php +++ b/libraries/src/Input/Json.php @@ -48,7 +48,7 @@ class Json extends Input * @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 e5f4130231700..aab0891ebe386 100644 --- a/libraries/src/Installer/InstallerExtension.php +++ b/libraries/src/Installer/InstallerExtension.php @@ -113,7 +113,7 @@ class InstallerExtension extends CMSObject * * @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/Multilanguage.php b/libraries/src/Language/Multilanguage.php index 02450596a0c45..addb9a468edd6 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 ebc47b6c87567..4196a808971ca 100644 --- a/libraries/src/MVC/Controller/AdminController.php +++ b/libraries/src/MVC/Controller/AdminController.php @@ -69,7 +69,7 @@ class AdminController extends BaseController * * @since 3.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) { parent::__construct($config, $factory, $app, $input); diff --git a/libraries/src/MVC/Controller/ApiController.php b/libraries/src/MVC/Controller/ApiController.php index e040e6ad205f4..331fb804e31e0 100644 --- a/libraries/src/MVC/Controller/ApiController.php +++ b/libraries/src/MVC/Controller/ApiController.php @@ -95,7 +95,7 @@ class ApiController extends BaseController * @since 4.0.0 * @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) { $this->modelState = new CMSObject(); diff --git a/libraries/src/MVC/Controller/BaseController.php b/libraries/src/MVC/Controller/BaseController.php index cccf50f5d985b..61be4f0705465 100644 --- a/libraries/src/MVC/Controller/BaseController.php +++ b/libraries/src/MVC/Controller/BaseController.php @@ -357,7 +357,7 @@ public static function getInstance($prefix, $config = []) * * @since 3.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) { $this->methods = []; $this->message = null; diff --git a/libraries/src/MVC/Controller/FormController.php b/libraries/src/MVC/Controller/FormController.php index e15c3c0b369e8..33d2020280f9c 100644 --- a/libraries/src/MVC/Controller/FormController.php +++ b/libraries/src/MVC/Controller/FormController.php @@ -91,10 +91,10 @@ class FormController extends BaseController implements FormFactoryAwareInterface */ public function __construct( $config = [], - MVCFactoryInterface $factory = null, + ?MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null, - FormFactoryInterface $formFactory = null + ?FormFactoryInterface $formFactory = null ) { parent::__construct($config, $factory, $app, $input); diff --git a/libraries/src/MVC/Model/AdminModel.php b/libraries/src/MVC/Model/AdminModel.php index 757a757bd8e46..f037cc7be6e9e 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 319587de43777..cb512cc82b8bb 100644 --- a/libraries/src/MVC/Model/BaseDatabaseModel.php +++ b/libraries/src/MVC/Model/BaseDatabaseModel.php @@ -84,7 +84,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); @@ -418,7 +418,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 20b074322795c..c6df41a1efd7c 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 8e1627e6aa402..95077cb1ab7c1 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 964e163ca2558..a846f99200ffd 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..c76085fe4a1e0 100644 --- a/libraries/src/MVC/View/JsonApiView.php +++ b/libraries/src/MVC/View/JsonApiView.php @@ -110,7 +110,7 @@ public function __construct($config = []) * * @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 ef07f41c9a04e..18114dd496fc5 100644 --- a/libraries/src/Mail/Exception/MailDisabledException.php +++ b/libraries/src/Mail/Exception/MailDisabledException.php @@ -54,7 +54,7 @@ final class MailDisabledException extends \RuntimeException * * @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 4a6118711161c..7d87880f68d43 100644 --- a/libraries/src/Mail/MailTemplate.php +++ b/libraries/src/Mail/MailTemplate.php @@ -92,7 +92,7 @@ class MailTemplate * * @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 3cc6f90907ab3..5c02ee55453d0 100644 --- a/libraries/src/Pagination/Pagination.php +++ b/libraries/src/Pagination/Pagination.php @@ -121,7 +121,7 @@ class Pagination * * @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 412cae126f45e..8c14cbaf95f87 100644 --- a/libraries/src/Pathway/SitePathway.php +++ b/libraries/src/Pathway/SitePathway.php @@ -31,7 +31,7 @@ class SitePathway extends Pathway * * @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 4a5b0b516db13..02296c3a501a6 100644 --- a/libraries/src/Plugin/PluginHelper.php +++ b/libraries/src/Plugin/PluginHelper.php @@ -159,7 +159,7 @@ public static function isEnabled($type, $plugin = null) * * @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 = []; @@ -216,7 +216,7 @@ public static function importPlugin($type, $plugin = null, $autocreate = true, D * * @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 5f46ab545142d..15e7b6255b2e1 100644 --- a/libraries/src/Router/Exception/RouteNotFoundException.php +++ b/libraries/src/Router/Exception/RouteNotFoundException.php @@ -29,7 +29,7 @@ class RouteNotFoundException extends \InvalidArgumentException * * @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 d88ece30e91cf..fca2880ac996d 100644 --- a/libraries/src/Router/SiteRouter.php +++ b/libraries/src/Router/SiteRouter.php @@ -62,7 +62,7 @@ class SiteRouter extends Router * * @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 44a2b09ed0bb5..8b816d7637c9a 100644 --- a/libraries/src/Serializer/JoomlaSerializer.php +++ b/libraries/src/Serializer/JoomlaSerializer.php @@ -49,7 +49,7 @@ public function __construct(string $type) * * @since 4.0.0 */ - public function getAttributes($post, array $fields = null) + public function getAttributes($post, ?array $fields = null) { if (!($post instanceof \stdClass) && !(\is_array($post)) && !($post instanceof CMSObject)) { $message = sprintf( diff --git a/libraries/src/Session/Session.php b/libraries/src/Session/Session.php index 777483e56de07..10cfaa14277b0 100644 --- a/libraries/src/Session/Session.php +++ b/libraries/src/Session/Session.php @@ -40,7 +40,7 @@ class Session extends BaseSession * * @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 2490dd3ccdd52..8bbdc77f268de 100644 --- a/libraries/src/Session/Storage/JoomlaStorage.php +++ b/libraries/src/Session/Storage/JoomlaStorage.php @@ -58,7 +58,7 @@ class JoomlaStorage extends NativeStorage * * @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/Category.php b/libraries/src/Table/Category.php index 44e536d227190..6358b95d8535a 100644 --- a/libraries/src/Table/Category.php +++ b/libraries/src/Table/Category.php @@ -98,7 +98,7 @@ protected function _getAssetTitle() * * @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 529233cb1ff56..553c588c8815e 100644 --- a/libraries/src/Table/Content.php +++ b/libraries/src/Table/Content.php @@ -97,7 +97,7 @@ protected function _getAssetTitle() * * @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/Language.php b/libraries/src/Table/Language.php index a0a3f26c54e22..5dc792168fd1d 100644 --- a/libraries/src/Table/Language.php +++ b/libraries/src/Table/Language.php @@ -138,7 +138,7 @@ protected function _getAssetTitle() * * @since 3.8.0 */ - 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/MenuType.php b/libraries/src/Table/MenuType.php index 348da756827ec..cef31ce79ce59 100644 --- a/libraries/src/Table/MenuType.php +++ b/libraries/src/Table/MenuType.php @@ -302,7 +302,7 @@ protected function _getAssetTitle() * * @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 59c4a1ac6f9e0..e887c3a4dfbcb 100644 --- a/libraries/src/Table/Module.php +++ b/libraries/src/Table/Module.php @@ -86,7 +86,7 @@ protected function _getAssetTitle() * * @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 11e5398eca71d..99e372e4422d1 100644 --- a/libraries/src/Table/Table.php +++ b/libraries/src/Table/Table.php @@ -162,7 +162,7 @@ abstract class Table extends CMSObject 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) { parent::__construct(); @@ -405,7 +405,7 @@ protected function _getAssetTitle() * * @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. /** @var Asset $assets */ diff --git a/libraries/src/Tag/TagServiceTrait.php b/libraries/src/Tag/TagServiceTrait.php index 98b378c5a98ce..3e5f929f8e4ec 100644 --- a/libraries/src/Tag/TagServiceTrait.php +++ b/libraries/src/Tag/TagServiceTrait.php @@ -57,7 +57,7 @@ public function countTagItems(array $items, string $extension) * * @since 4.0.0 */ - protected function getTableNameForSection(string $section = null) + protected function getTableNameForSection(?string $section = null) { return null; } @@ -71,7 +71,7 @@ protected function getTableNameForSection(string $section = 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 4b4f507fda10d..b9a0b6eb1fa34 100644 --- a/libraries/src/Toolbar/Toolbar.php +++ b/libraries/src/Toolbar/Toolbar.php @@ -96,7 +96,7 @@ class Toolbar * * @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 bfd8999c36748..b59bdf3b245e1 100644 --- a/libraries/src/UCM/UCMBase.php +++ b/libraries/src/UCM/UCMBase.php @@ -49,7 +49,7 @@ class UCMBase implements UCM * * @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(); @@ -70,7 +70,7 @@ public function __construct($alias = null, UCMType $type = null) * @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'); @@ -124,7 +124,7 @@ public function getType() * * @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 7235a671f82da..ece1407a64279 100644 --- a/libraries/src/UCM/UCMContent.php +++ b/libraries/src/UCM/UCMContent.php @@ -51,7 +51,7 @@ class UCMContent extends UCMBase * * @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); @@ -73,7 +73,7 @@ public function __construct(TableInterface $table = null, $alias = null, UCMType * * @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; @@ -100,7 +100,7 @@ public function save($original = null, UCMType $type = null) * * @since 3.1 */ - public function delete($pk, UCMType $type = null) + public function delete($pk, ?UCMType $type = null) { $db = Factory::getDbo(); $type = $type ?: $this->type; @@ -131,7 +131,7 @@ public function delete($pk, UCMType $type = null) * * @since 3.1 */ - public function mapData($original, UCMType $type = null) + public function mapData($original, ?UCMType $type = null) { $contentType = $type ?: $this->type; @@ -180,7 +180,7 @@ public function mapData($original, UCMType $type = null) * * @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 d6897b227cbf2..b6be320627aa5 100644 --- a/libraries/src/UCM/UCMType.php +++ b/libraries/src/UCM/UCMType.php @@ -91,7 +91,7 @@ class UCMType implements UCM * * @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 12dbec00a6c8f..b92e2027f2c7d 100644 --- a/libraries/src/WebAsset/AssetItem/LangActiveAssetItem.php +++ b/libraries/src/WebAsset/AssetItem/LangActiveAssetItem.php @@ -37,7 +37,7 @@ class LangActiveAssetItem extends WebAssetItem */ 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 b1e43b3587de3..14afc58e8b904 100644 --- a/libraries/src/WebAsset/WebAssetItem.php +++ b/libraries/src/WebAsset/WebAssetItem.php @@ -87,7 +87,7 @@ class WebAssetItem implements WebAssetItemInterface */ 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 c77ff55c1064f..7ed534088fa88 100644 --- a/libraries/src/WebAsset/WebAssetManager.php +++ b/libraries/src/WebAsset/WebAssetManager.php @@ -731,7 +731,7 @@ public function getManagerState(): array * * @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() @@ -956,8 +956,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 f4fb825fe4987..00ae2288cfb06 100644 --- a/libraries/src/WebAsset/WebAssetRegistry.php +++ b/libraries/src/WebAsset/WebAssetRegistry.php @@ -233,7 +233,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 1c2740ecdb26c..e4e04a81be534 100644 --- a/libraries/src/Workflow/WorkflowPluginTrait.php +++ b/libraries/src/Workflow/WorkflowPluginTrait.php @@ -66,7 +66,7 @@ protected function enhanceWorkflowTransitionForm(Form $form, $data) * * @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'); diff --git a/plugins/privacy/actionlogs/src/Extension/Actionlogs.php b/plugins/privacy/actionlogs/src/Extension/Actionlogs.php index bd5e8c046a5e6..6bc549eab7b45 100644 --- a/plugins/privacy/actionlogs/src/Extension/Actionlogs.php +++ b/plugins/privacy/actionlogs/src/Extension/Actionlogs.php @@ -37,7 +37,7 @@ final class Actionlogs 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/consents/src/Extension/Consents.php b/plugins/privacy/consents/src/Extension/Consents.php index 05ffe252cbbc7..ef6fa28b51967 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 9ea1b6651d6fe..e4709d0cdadbf 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 55a02de203f19..08858f77ec4f9 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 809805a25aa8a..53e1535524e24 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/privacy/user/src/Extension/UserPlugin.php b/plugins/privacy/user/src/Extension/UserPlugin.php index 7d42c4c0e7cc1..50b829a7405ac 100644 --- a/plugins/privacy/user/src/Extension/UserPlugin.php +++ b/plugins/privacy/user/src/Extension/UserPlugin.php @@ -43,7 +43,7 @@ final class UserPlugin extends PrivacyPlugin * * @since 3.9.0 */ - public function onPrivacyCanRemoveData(RequestTable $request, User $user = null) + public function onPrivacyCanRemoveData(RequestTable $request, ?User $user = null) { $status = new Status(); @@ -76,7 +76,7 @@ public function onPrivacyCanRemoveData(RequestTable $request, User $user = null) * * @since 3.9.0 */ - public function onPrivacyExportRequest(RequestTable $request, User $user = null) + public function onPrivacyExportRequest(RequestTable $request, ?User $user = null) { if (!$user) { return []; @@ -107,7 +107,7 @@ public function onPrivacyExportRequest(RequestTable $request, User $user = null) * * @since 3.9.0 */ - public function onPrivacyRemoveData(RequestTable $request, User $user = null) + public function onPrivacyRemoveData(RequestTable $request, ?User $user = null) { // This plugin only processes data for registered user accounts if (!$user) { diff --git a/plugins/system/webauthn/src/Authentication.php b/plugins/system/webauthn/src/Authentication.php index b3f22e1aa9108..4644d26513d5d 100644 --- a/plugins/system/webauthn/src/Authentication.php +++ b/plugins/system/webauthn/src/Authentication.php @@ -96,9 +96,9 @@ final class Authentication * @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 42275e25ebcbf..ecc5e01ba2f35 100644 --- a/plugins/system/webauthn/src/CredentialRepository.php +++ b/plugins/system/webauthn/src/CredentialRepository.php @@ -44,7 +44,7 @@ final class CredentialRepository implements PublicKeyCredentialSourceRepository, * * @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 49a43d5f504f8..abd68020a2cad 100644 --- a/plugins/system/webauthn/src/Extension/Webauthn.php +++ b/plugins/system/webauthn/src/Extension/Webauthn.php @@ -113,7 +113,7 @@ final class Webauthn extends CMSPlugin implements SubscriberInterface * * @since 4.0.0 */ - public function __construct(&$subject, array $config = [], Authentication $authHelper = null) + public function __construct(&$subject, array $config = [], ?Authentication $authHelper = null) { parent::__construct($subject, $config); 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 fabdbeae55a0f..51d7a9e463ec0 100644 --- a/tests/Unit/Plugin/Authentication/Ldap/LdapPluginTest.php +++ b/tests/Unit/Plugin/Authentication/Ldap/LdapPluginTest.php @@ -333,7 +333,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();