v4.0.0 — FriendlyCaptcha v2 API (fixes from PR #10)#13
Open
ossycodes wants to merge 3 commits into
Open
Conversation
- Fix: verifyResponse() now always returns $this instead of false/bool, preventing fatal TypeError when captcha field is missing - Fix: rename $error to $errors to match usage throughout the class - Fix: sendRequestVerify() uses json instead of form_params for v2 JSON API - Fix: SDK version aligned to @0.2.0 across all files - Fix: bootLang() removed — translations loaded directly in boot() instead of overwriting the Rule macro registered by bootMacro() - Fix: Rules/FriendlyCaptcha now implements ValidationRule (Laravel 10+) instead of the removed Illuminate\Contracts\Validation\Rule interface - Fix: test methods renamed with test_ prefix (PHPUnit 11 removed @test) - Fix: CHANGELOG version corrected to 4.0.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR applies all the fixes identified during review of #10 by @KRMM2025 and prepares the codebase for a
v4.0.0major release. All credit for the v2 API migration goes to @KRMM2025 — this branch just addresses the bugs before merging.Changes from #10:
verifyResponse()returnedfalse(bool) → fatalTypeErrorinRules::passes()$this; setsisSuccess = falseon empty inputbootLang()overwrotebootMacro()'sRule::macro→Rule::friendlycaptcha()crashedbootLang(); translations loaded directly inboot()$errordeclared but$errorsused → dynamic property,getErrors()returnednull$errorsIlluminate\Contracts\Validation\Ruleremoved in Laravel 12Illuminate\Contracts\Validation\ValidationRule+validate()form_paramssends form-encoded; v2 API expects JSONjsonkey in Guzzle request@testannotations removed in PHPUnit 11 → no tests foundtest_prefix@0.1.36in code,@0.2.0in CHANGELOG)@0.2.0Test plan
Rule::friendlycaptcha()returns a rule instancefriendlycaptcha::validation.*@KRMM2025 — could you review this and confirm the v2 API behaviour looks correct from your testing? Happy to adjust anything.
🤖 Generated with Claude Code