-
-
Notifications
You must be signed in to change notification settings - Fork 138
Implemented new ChartGoogleQrCodeProvider #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Wouldn't Other than that (haven't tested it, but assuming it works): looks good to me! |
Yep, name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me although it should probably reference the Image Charts provider where verifySSL is the first parameter of the function and is also double checked to confirm it is a boolean.
TwoFactorAuth/lib/Providers/Qr/ImageChartsQRCodeProvider.php
Lines 19 to 25 in e15885c
public function __construct($verifyssl = false, $errorcorrectionlevel = 'L', $margin = 1) | |
{ | |
if (!is_bool($verifyssl)) { | |
throw new QRException('VerifySSL must be bool'); | |
} | |
$this->verifyssl = $verifyssl; |
I think it will be redundant (check the boolean type). The user can, for example, pass the "string" in the "margin" parameter. |
In this case, the value is passed directly into curl which means if the library doesn't double check about the boolean and a value which isn't literally a boolean is passed into curl then I'm not sure the behaviour would be what the developer desires.
It has been mentioned before that consistency is important so these libraries should be very similar if not identical. I notice that you've added an encoding parameter that doesn't seem to get used so technically, could you extend the ImageChartsQRCodeProvider instead of the base one and then you only need to override one function? |
Yeah, I saw code structure attentively and have pushed a new commit Thank you for your comment about the encoding option. Inserted that option in the query to Google API. An extend the ImageChartsQRCodeProvider forces to add a parameter there and not use it |
I was experiencing a déjà vu but now I remember why 😂 I'm actually not quite sure why it got removed in the first place... Anyway, I'm sorry this took a while; I've been quite busy. I hope to get around to merging this PR this week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏 LGTM
Merged and published 1.8.1. Thanks @fman42 and @willpower232 🙏 |
Hello!
Implemented new provider that using Google API for generating QR
I think it will be helpful somebody like me who need use Google API within this package