Problem/Motivation

$alreadyAccepted is used as a bool, but type hinted as a string, this causes alerts from phpstan when writing a custom plugin.

Steps to reproduce

Review TFABasePlugin, observe it is assigned boolean values not string values.

In both TfaTotpValidation and TfaHotpValidation we already override this typehint giving more weight to the argument this can be changed.

Proposed resolution

Change typehint to bool, remove unnecessary definitions in extending classes.

Remaining tasks

User interface changes

None

API changes

Typehint change correcting to match how variable has been actually utilized.

Data model changes

None

Issue fork tfa-3351698

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

cmlara created an issue. See original summary.

cmlara’s picture

Priority: Normal » Minor
Status: Active » Needs review

  • cmlara committed 66dc84f7 on 8.x-1.x
    Issue #3351698: Typehint for TfaBasePlugin $alreadyAccepted should be...

  • cmlara committed ac61c875 on 2.x
    Issue #3351698: Typehint for TfaBasePlugin $alreadyAccepted should be...
cmlara’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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