Problem/Motivation
PHP 8.4 compatibility: Implicitly marking parameter $homebox as nullable is deprecated, the explicit nullable type must be used instead at several lines of code.
$ find ./homebox/ -name *.php | xargs -n1 php -l
No syntax errors detected in ./homebox/modules/homebox_portlet_type_examples/src/Plugin/HomeboxPortletType/LockedSettings.php
No syntax errors detected in ./homebox/modules/homebox_portlet_type_examples/src/Plugin/HomeboxPortletType/SimpleForm.php
No syntax errors detected in ./homebox/modules/homebox_portlet_type_examples/src/Plugin/HomeboxPortletType/Simple.php
PHP Deprecated: Drupal\homebox_portlet_type_block\Plugin\HomeboxPortletType\HomeboxPortletTypeBlock::__construct(): Implicitly marking parameter $homebox as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/modules/homebox_portlet_type_block/src/Plugin/HomeboxPortletType/HomeboxPortletTypeBlock.php on line 65
Deprecated: Drupal\homebox_portlet_type_block\Plugin\HomeboxPortletType\HomeboxPortletTypeBlock::__construct(): Implicitly marking parameter $homebox as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/modules/homebox_portlet_type_block/src/Plugin/HomeboxPortletType/HomeboxPortletTypeBlock.php on line 65
PHP Deprecated: Drupal\homebox_portlet_type_block\Plugin\HomeboxPortletType\HomeboxPortletTypeBlock::__construct(): Implicitly marking parameter $delta as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/modules/homebox_portlet_type_block/src/Plugin/HomeboxPortletType/HomeboxPortletTypeBlock.php on line 65
Deprecated: Drupal\homebox_portlet_type_block\Plugin\HomeboxPortletType\HomeboxPortletTypeBlock::__construct(): Implicitly marking parameter $delta as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/modules/homebox_portlet_type_block/src/Plugin/HomeboxPortletType/HomeboxPortletTypeBlock.php on line 65
No syntax errors detected in ./homebox/modules/homebox_portlet_type_block/src/Plugin/HomeboxPortletType/HomeboxPortletTypeBlock.php
No syntax errors detected in ./homebox/homebox.api.php
No syntax errors detected in ./homebox/tests/src/Functional/AccessTest.php
No syntax errors detected in ./homebox/tests/src/Functional/FunctionalHomeboxTestBase.php
No syntax errors detected in ./homebox/tests/src/Functional/HomeboxTestHelper.php
No syntax errors detected in ./homebox/src/HomeboxAccessControlHandler.php
No syntax errors detected in ./homebox/src/Annotation/HomeboxPortletType.php
No syntax errors detected in ./homebox/src/Element/HomeboxPortletEdit.php
No syntax errors detected in ./homebox/src/Element/HomeboxButton.php
No syntax errors detected in ./homebox/src/Element/HomeboxPortletEditTitlebar.php
PHP Deprecated: Drupal\homebox\HomeboxPortletTypePluginManager::createInstance(): Implicitly marking parameter $homebox as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/HomeboxPortletTypePluginManager.php on line 48
Deprecated: Drupal\homebox\HomeboxPortletTypePluginManager::createInstance(): Implicitly marking parameter $homebox as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/HomeboxPortletTypePluginManager.php on line 48
PHP Deprecated: Drupal\homebox\HomeboxPortletTypePluginManager::createInstance(): Implicitly marking parameter $delta as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/HomeboxPortletTypePluginManager.php on line 48
Deprecated: Drupal\homebox\HomeboxPortletTypePluginManager::createInstance(): Implicitly marking parameter $delta as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/HomeboxPortletTypePluginManager.php on line 48
No syntax errors detected in ./homebox/src/HomeboxPortletTypePluginManager.php
No syntax errors detected in ./homebox/src/HomeboxPresetsListBuilder.php
PHP Deprecated: Drupal\homebox\Entity\Homebox::setPortletArrayByValues(): Implicitly marking parameter $thirdPartySettings as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Entity/Homebox.php on line 447
Deprecated: Drupal\homebox\Entity\Homebox::setPortletArrayByValues(): Implicitly marking parameter $thirdPartySettings as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Entity/Homebox.php on line 447
PHP Deprecated: Drupal\homebox\Entity\Homebox::addPortletByValues(): Implicitly marking parameter $thirdPartySettings as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Entity/Homebox.php on line 468
Deprecated: Drupal\homebox\Entity\Homebox::addPortletByValues(): Implicitly marking parameter $thirdPartySettings as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Entity/Homebox.php on line 468
No syntax errors detected in ./homebox/src/Entity/Homebox.php
No syntax errors detected in ./homebox/src/Entity/Routing/HomeboxAdminHtmlRouteProvider.php
PHP Deprecated: Drupal\homebox\Entity\HomeboxInterface::addPortletByValues(): Implicitly marking parameter $thirdPartySettings as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Entity/HomeboxInterface.php on line 196
Deprecated: Drupal\homebox\Entity\HomeboxInterface::addPortletByValues(): Implicitly marking parameter $thirdPartySettings as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Entity/HomeboxInterface.php on line 196
PHP Deprecated: Drupal\homebox\Entity\HomeboxInterface::setPortletArrayByValues(): Implicitly marking parameter $thirdPartySettings as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Entity/HomeboxInterface.php on line 218
Deprecated: Drupal\homebox\Entity\HomeboxInterface::setPortletArrayByValues(): Implicitly marking parameter $thirdPartySettings as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Entity/HomeboxInterface.php on line 218
No syntax errors detected in ./homebox/src/Entity/HomeboxInterface.php
No syntax errors detected in ./homebox/src/Entity/HomeboxTypeInterface.php
No syntax errors detected in ./homebox/src/Entity/HomeboxType.php
No syntax errors detected in ./homebox/src/HomeboxListBuilder.php
PHP Deprecated: Drupal\homebox\Plugin\HomeboxPortletTypeBase::__construct(): Implicitly marking parameter $homebox as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Plugin/HomeboxPortletTypeBase.php on line 109
Deprecated: Drupal\homebox\Plugin\HomeboxPortletTypeBase::__construct(): Implicitly marking parameter $homebox as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Plugin/HomeboxPortletTypeBase.php on line 109
PHP Deprecated: Drupal\homebox\Plugin\HomeboxPortletTypeBase::__construct(): Implicitly marking parameter $delta as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Plugin/HomeboxPortletTypeBase.php on line 109
Deprecated: Drupal\homebox\Plugin\HomeboxPortletTypeBase::__construct(): Implicitly marking parameter $delta as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Plugin/HomeboxPortletTypeBase.php on line 109
No syntax errors detected in ./homebox/src/Plugin/HomeboxPortletTypeBase.php
No syntax errors detected in ./homebox/src/Plugin/HomeboxPortletTypeInterface.php
No syntax errors detected in ./homebox/src/Plugin/ThirdPartyConfigurationInterface.php
No syntax errors detected in ./homebox/src/Plugin/Validation/Constraint/UniqueDefaultPresetConstraintValidator.php
No syntax errors detected in ./homebox/src/Plugin/Validation/Constraint/UniqueDefaultPresetConstraint.php
No syntax errors detected in ./homebox/src/Plugin/Field/FieldWidget/PortletWidget.php
No syntax errors detected in ./homebox/src/Plugin/Field/FieldType/PortletItem.php
No syntax errors detected in ./homebox/src/HomeboxPermissions.php
No syntax errors detected in ./homebox/src/Controller/HomeboxTypeController.php
PHP Deprecated: Drupal\homebox\Controller\HomeboxController::buildPage(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 68
Deprecated: Drupal\homebox\Controller\HomeboxController::buildPage(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 68
PHP Deprecated: Drupal\homebox\Controller\HomeboxController::build(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 95
Deprecated: Drupal\homebox\Controller\HomeboxController::build(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 95
PHP Deprecated: Drupal\homebox\Controller\HomeboxController::buildPageTitle(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 113
Deprecated: Drupal\homebox\Controller\HomeboxController::buildPageTitle(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 113
PHP Deprecated: Drupal\homebox\Controller\HomeboxController::buildPagePersonalize(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 148
Deprecated: Drupal\homebox\Controller\HomeboxController::buildPagePersonalize(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 148
PHP Deprecated: Drupal\homebox\Controller\HomeboxController::buildUserTabPersonalize(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 165
Deprecated: Drupal\homebox\Controller\HomeboxController::buildUserTabPersonalize(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 165
PHP Deprecated: Drupal\homebox\Controller\HomeboxController::buildPersonalize(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 180
Deprecated: Drupal\homebox\Controller\HomeboxController::buildPersonalize(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 180
PHP Deprecated: Drupal\homebox\Controller\HomeboxController::buildPersonalizePortletAdd(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 198
Deprecated: Drupal\homebox\Controller\HomeboxController::buildPersonalizePortletAdd(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 198
PHP Deprecated: Drupal\homebox\Controller\HomeboxController::accessPage(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 297
Deprecated: Drupal\homebox\Controller\HomeboxController::accessPage(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 297
PHP Deprecated: Drupal\homebox\Controller\HomeboxController::accessUserTab(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 326
Deprecated: Drupal\homebox\Controller\HomeboxController::accessUserTab(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 326
PHP Deprecated: Drupal\homebox\Controller\HomeboxController::accessPagePersonalize(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 355
Deprecated: Drupal\homebox\Controller\HomeboxController::accessPagePersonalize(): Implicitly marking parameter $owner as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 355
PHP Deprecated: Drupal\homebox\Controller\HomeboxController::accessUserTabPersonalize(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 384
Deprecated: Drupal\homebox\Controller\HomeboxController::accessUserTabPersonalize(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Controller/HomeboxController.php on line 384
No syntax errors detected in ./homebox/src/Controller/HomeboxController.php
No syntax errors detected in ./homebox/src/HomeboxTypeListBuilder.php
No syntax errors detected in ./homebox/src/HomeboxTypeAccessControlHandler.php
PHP Deprecated: Drupal\homebox\Form\HomeboxPortletAddForm::buildForm(): Implicitly marking parameter $homebox as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Form/HomeboxPortletAddForm.php on line 64
Deprecated: Drupal\homebox\Form\HomeboxPortletAddForm::buildForm(): Implicitly marking parameter $homebox as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Form/HomeboxPortletAddForm.php on line 64
No syntax errors detected in ./homebox/src/Form/HomeboxPortletAddForm.php
No syntax errors detected in ./homebox/src/Form/HomeboxSettingsForm.php
No syntax errors detected in ./homebox/src/Form/HomeboxTypeForm.php
No syntax errors detected in ./homebox/src/Form/HomeboxTypeDeleteForm.php
PHP Deprecated: Drupal\homebox\Form\HomeboxDefaultPresetConfirmForm::buildForm(): Implicitly marking parameter $homebox as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Form/HomeboxDefaultPresetConfirmForm.php on line 87
Deprecated: Drupal\homebox\Form\HomeboxDefaultPresetConfirmForm::buildForm(): Implicitly marking parameter $homebox as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Form/HomeboxDefaultPresetConfirmForm.php on line 87
No syntax errors detected in ./homebox/src/Form/HomeboxDefaultPresetConfirmForm.php
PHP Deprecated: Drupal\homebox\Form\HomeboxListFilterForm::buildForm(): Implicitly marking parameter $homeboxType as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Form/HomeboxListFilterForm.php on line 54
Deprecated: Drupal\homebox\Form\HomeboxListFilterForm::buildForm(): Implicitly marking parameter $homeboxType as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Form/HomeboxListFilterForm.php on line 54
No syntax errors detected in ./homebox/src/Form/HomeboxListFilterForm.php
PHP Deprecated: Drupal\homebox\Form\HomeboxForm::__construct(): Implicitly marking parameter $entity_type_bundle_info as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Form/HomeboxForm.php on line 37
Deprecated: Drupal\homebox\Form\HomeboxForm::__construct(): Implicitly marking parameter $entity_type_bundle_info as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Form/HomeboxForm.php on line 37
PHP Deprecated: Drupal\homebox\Form\HomeboxForm::__construct(): Implicitly marking parameter $time as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Form/HomeboxForm.php on line 37
Deprecated: Drupal\homebox\Form\HomeboxForm::__construct(): Implicitly marking parameter $time as nullable is deprecated, the explicit nullable type must be used instead in ./homebox/src/Form/HomeboxForm.php on line 37
No syntax errors detected in ./homebox/src/Form/HomeboxForm.php
No syntax errors detected in ./homebox/src/Form/HomeboxDeleteForm.php
No syntax errors detected in ./homebox/src/Form/HomeboxSubformState.php
No syntax errors detected in ./homebox/src/HomeboxViewBuilder.php
No syntax errors detected in ./homebox/src/Exception/HomeboxMissingDefaultPresetException.php
No syntax errors detected in ./homebox/src/Exception/HomeboxTypeNotFoundException.php
No syntax errors detected in ./homebox/src/EventSubscriber/HomeboxTypeRouteSubscriber.phpSteps to reproduce
Use PHP 8.4.
Proposed resolution
Use explicit nullable type like recommended here: https://dev.to/gromnan/fix-php-84-deprecation-implicitly-marking-paramet...
Issue fork homebox-3566106
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
anybodyThank you, happy to review the fix once a MR is ready.
Comment #5
nisha_j commentedThe MR fixes PHP 8.4 deprecation warnings caused by implicitly nullable parameters.
All affected method signatures have been updated to use explicit nullable types (e.g. ?Type $param = NULL).
Verified locally using PHP 8.4 with E_ALL enabled; no remaining deprecation warnings.
Thanks
Comment #6
anybodyThanks! We'll check that and tag a new release soon!
Comment #7
rauch commentedThanks for the MR. After installing the patch I get the following deprecation warnings:
Comment #8
anybodyComment #10
grevil commentedAlright, that's it.
The settings form still had some old backwards compatibility code for D9. I changed the order of some other services and implemented an update hook to avoid WSOD on update because of the different service injection order.
Please review!
Comment #11
anybodyWell done @grevil!
Comment #13
grevil commentedComment #15
grevil commentedFixed. Thanks all!