Problem/Motivation

Deprecation warning after upgrading to 2.0.7 on D11.3.5:

Deprecated function: Drupal\email_tfa\Plugin\Block\EmailTfaUserLoginBlock::__construct(): Implicitly marking parameter $config_factory as nullable is deprecated, the explicit nullable type must be used instead in include() (line 576 of /var/www/drupal11upgrade4/vendor/composer/ClassLoader.php).

Steps to reproduce

Upgrade email_tfa to 2.0.7 on D11.3.5 and probably others using PHP 8.4 or higher.

Proposed resolution

Add one character (question mark) to \src\Plugin\Block\EmailTfaUserLoginBlock.php:

public function __construct(array $configuration, string $plugin_id, $plugin_definition, RouteMatchInterface $route_match, FormBuilderInterface|ConfigFactoryInterface $form_builder, ConfigFactoryInterface $config_factory = NULL) {

public function __construct(array $configuration, string $plugin_id, $plugin_definition, RouteMatchInterface $route_match, FormBuilderInterface|ConfigFactoryInterface $form_builder, ?ConfigFactoryInterface $config_factory = NULL) {

Issue fork email_tfa-3580574

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

rclemings created an issue. See original summary.

abdulaziz zaid made their first commit to this issue’s fork.

abdulaziz zaid’s picture

Status: Active » Fixed

Thx rclemings

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.

Status: Fixed » Closed (fixed)

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