Skip to content

refactor: cleanup Hmac command - #1398

Open
paulbalandan wants to merge 2 commits into
codeigniter4:developfrom
paulbalandan:phpstan-property-nonobject
Open

paulbalandan wants to merge 2 commits into
codeigniter4:developfrom
paulbalandan:phpstan-property-nonobject

Conversation

@paulbalandan

Copy link
Copy Markdown
Member

Description
Refactors the Hmac command:

  • Removes property.nonObject errors
  • Removes unnecessary $that = $this and $encrypter = $this->encrypter assigns by using a non-static closure
  • The saving model is instantiated once per run, not per action

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@paulbalandan paulbalandan added the refactor Pull requests that refactor code label Nov 9, 2026
@paulbalandan
paulbalandan force-pushed the phpstan-property-nonobject branch from 54b7bd1 to c21b2b7 Compare November 9, 2026 12:37
@paulbalandan
paulbalandan force-pushed the phpstan-property-nonobject branch from c21b2b7 to 74bf1fc Compare November 9, 2026 12:40
@paulbalandan

Copy link
Copy Markdown
Member Author

The second commit reduces the visibility of the action methods from public to private thus reaching 100% MSI. I believe this is fine as I don't think anyone would be calling this command programmatically like (new Hmac())->encrypt(). As such this is just potentially BC breaking with a low chance. Otherwise, please let me know and it can be reverted.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Pull requests that refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant