Fix docs: Construct new TwoFactorAuth-class#110
Fix docs: Construct new TwoFactorAuth-class#110willpower232 merged 7 commits intoRobThree:masterfrom
Conversation
willpower232
left a comment
There was a problem hiding this comment.
This is an excellent observation however technically one doesn't need to specify the other arguments now the minimum supported version of PHP is greater than 8 so this example could be $tfa = new TwoFactorAuth(qrcodeprovider: $qrCodeProvider);
That said, the documentation about algorithm at docs/optional-configuration.md is definitely out of date.
|
Sorry, I really forget this. |
|
In this case it makes sense as I can imagine a significant number of users would just want to specify the name of the application and a QR code provider, unless one is developing for a specific hardware token or custom application then the default SHA1 should suffice which thanks to PHP 8 means you don't need to specify most of the constructor arguments. Are you going to edit docs/optional-configuration.md as well? |
|
Done.
But wouldn't it then not making more sense to change the position of the CodeProvider, so that the time when a code gets unvalid and the number of digits don't have to specified when defining the class? Like this: |
willpower232
left a comment
There was a problem hiding this comment.
Unfortunately hindsight is 20:20 as they say, the construct method signature could have been made in a slightly more efficient way but that doesn't really matter any more thanks to newer PHP versions.
Also changing it would constitute a major breaking change for unsuspecting users so its better left as is for now.
Github won't let me suggest what the final wording should be but I think it should be this
|
I have done this now, like you proposed. Additionally, I fixed the hyperlinks for the documentation about the different online and offline providers. All hyperlinks had the file extension ".html", but it is ".md". ;-) |
|
You're right! Changed it. |
|
apologies for the delay! I wanted to do this at a time I could watch the build to make sure the docs website still works. |

Hey,
your documentation to create a new object of the TwoFactorAuth class is wrong.
A single string like "sha1" is not enough; expected is an argument of Algorithm.