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.php

Steps 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

Command icon 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

rauch created an issue. See original summary.

nisha_j made their first commit to this issue’s fork.

anybody’s picture

Version: 3.0.0 » 3.0.x-dev

Thank you, happy to review the fix once a MR is ready.

nisha_j’s picture

Status: Active » Needs review

The 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

anybody’s picture

Assigned: Unassigned » grevil
Issue tags: +PHP 8.4

Thanks! We'll check that and tag a new release soon!

rauch’s picture

Thanks for the MR. After installing the patch I get the following deprecation warnings:

PHP Deprecated:  Drupal\homebox\Form\HomeboxForm::__construct(): Optional parameter $entity_type_bundle_info declared before required parameter $current_user is implicitly treated as a required parameter in /var/www/html/web/modules/contrib/homebox/src/Form/HomeboxForm.php on line 37

Deprecated: Drupal\homebox\Form\HomeboxForm::__construct(): Optional parameter $entity_type_bundle_info declared before required parameter $current_user is implicitly treated as a required parameter in /var/www/html/web/modules/contrib/homebox/src/Form/HomeboxForm.php on line 37
PHP Deprecated:  Drupal\homebox\Form\HomeboxForm::__construct(): Optional parameter $time declared before required parameter $current_user is implicitly treated as a required parameter in /var/www/html/web/modules/contrib/homebox/src/Form/HomeboxForm.php on line 37

Deprecated: Drupal\homebox\Form\HomeboxForm::__construct(): Optional parameter $time declared before required parameter $current_user is implicitly treated as a required parameter in /var/www/html/web/modules/contrib/homebox/src/Form/HomeboxForm.php on line 37
PHP Deprecated:  Drupal\config_ignore\Form\IgnoreSettingsForm::buildForm(): Implicitly marking parameter $request as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/config_ignore/src/Form/IgnoreSettingsForm.php on line 36

Deprecated: Drupal\config_ignore\Form\IgnoreSettingsForm::buildForm(): Implicitly marking parameter $request as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/config_ignore/src/Form/IgnoreSettingsForm.php on line 36
anybody’s picture

Assigned: grevil » Unassigned
Status: Needs review » Needs work

grevil made their first commit to this issue’s fork.

grevil’s picture

Status: Needs work » Needs review

Alright, 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!

anybody’s picture

Status: Needs review » Reviewed & tested by the community

Well done @grevil!

  • grevil committed a23cd593 on 3.0.x authored by nisha_j
    fix: #3566106 PHP 8.4 compatibility: Implicitly marking parameter $...
grevil’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

grevil’s picture

Fixed. Thanks all!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.