Skip to content

User2FA: light refactoring - #1100

Open
afk11 wants to merge 1 commit into
mainfrom
user-2fa-no-fillable
Open

afk11 wants to merge 1 commit into
mainfrom
user-2fa-no-fillable

Conversation

@afk11

@afk11 afk11 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

A User2FA record is created and the only change to affect it is to later set enabled to true. It doesn't need fillable properties, so refactor them out.

  • Extract User2FA::setupForUser static factory method
  • Extract the $this->enabled=true update into an enable method
  • Define isEnabled()
  • Add a boolean cast to $enabled, since we only use it for boolean logic.
  • Use strict types

@afk11
afk11 force-pushed the user-2fa-no-fillable branch from ac6c214 to d61bb2e Compare September 8, 2026 19:19
@afk11 afk11 changed the title User2FA: simplify and type improvements User2FA: light refactoring Sep 8, 2026
…ethod into a method.

also, remove fillable, add boolean cast to 'enabled', and add strict_types=1

and define isEnabled()
@afk11
afk11 force-pushed the user-2fa-no-fillable branch from d61bb2e to fd9bcc9 Compare September 8, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant