Conversation
Signed-off-by: Kent Rasmussen <hyprkookeez@gmail.com>
Signed-off-by: Kent Rasmussen <hyprkookeez@gmail.com>
|
@Ocramius Sorry for the ping, but is there any chance you can take a look at this and laminas/laminas-captcha#32, or point me to someone who can? This is one of the things preventing us from migrating to PHP 8.2. |
gsteel
left a comment
There was a problem hiding this comment.
Hi @earthiverse - Thank you for the contributions! There are a number of BC breaks here. If your plan is to get the interface released in the 3.x series, it'll have to drop all the native types.
src/RecaptchaServiceInterface.php
Outdated
| /** | ||
| * An interface for interacting with a recaptcha service provider | ||
| */ | ||
| interface RecaptchaServiceInterface |
There was a problem hiding this comment.
It is not necessary to add all of the methods present in the concrete class to the interface.
Probably, the only methods required here are verify and possibly getSiteKey as this may be needed for output in the markup/javascript.
Again, using parameter and return types here will force BC breaking changes on the existing concrete class.
There was a problem hiding this comment.
Thank you for the review!
laminas-captcha has calls to all of the functions in the interface, I think because it can create the service by itself if the options are provided.
I'll remove the types as a start :)
There was a problem hiding this comment.
laminas-captchahas calls to all of the functions in the interface…
The implementations on both sides (recaptcha and captcha) are not future-proof but with the current suggestions for an interface we also nail down all the unnecessary methods. The interface would then have to be changed again with the next major update. This cannot be the goal.
Signed-off-by: Kent Rasmussen <hyprkookeez@gmail.com>
Signed-off-by: Kent Rasmussen <hyprkookeez@gmail.com>
Description
laminas-captcha@2.17uses a class marked as final for the service. Making an interface will also allow an easier pathway to adding Recaptcha V3 support. See the related merge request on laminas-captchaI'm not sure about laminas's best practices, let me know if there are things that need fixing.