-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
I strongly recommend that you make the class stateless rather than statefull as you have it now.
Basically, don't pass in input to the constructor, but instead have discrete encrypt($text) and decrypt($text) methods.
This will make it far easier to reason about what's going on, because object state doesn't need to be considered. And separating encryption flows from decryption flows will also provide clarity.
And as a stateless object, it can be re-used (which means things like setup can be shared across encryption/decryption runs).
Metadata
Metadata
Assignees
Labels
No labels