Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,20 @@ with additional error codes based on the client's checks. When adding a new
[`RequestMethod`](./src/ReCaptcha/RequestMethod.php) ensure that it returns the
`ReCaptcha::E_CONNECTION_FAILED` and `ReCaptcha::E_BAD_RESPONSE` where
appropriate.

## Public API compatibility

The 1.x line treats the following classes and interfaces as public API:
`ReCaptcha`, `RequestMethod`, `Response`, `RequestParameters`,
`RequestMethod\Post`, `RequestMethod\CurlPost`, and
`RequestMethod\SocketPost`, plus the request wrapper classes
`RequestMethod\Curl` and `RequestMethod\Socket`.

Changes that narrow those APIs, such as adding native scalar parameter types,
adding native return types to existing public methods, making public non-final
classes `readonly` or `final`, removing public classes, or removing existing
constructor argument forms, should be reserved for a major release.

The `RequestMethod::submit()` interface intentionally keeps its 1.x-compatible
native signature. Implementations are still expected to return the body of the
reCAPTCHA response as a string.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ and v3.
- reCAPTCHA: https://cloud.google.com/security/products/recaptcha
- This repo: https://github.com/google/recaptcha
- Hosted demo: https://recaptcha-demo.appspot.com/
- Version: 1.5.0
- Version: 1.5.1
- License: BSD, see [LICENSE](LICENSE)

> [!IMPORTANT]
Expand Down Expand Up @@ -169,6 +169,11 @@ $recaptcha = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\Sock

For more details on usage and structure, see [ARCHITECTURE](ARCHITECTURE.md).

The 1.x line preserves compatibility for the public request and response APIs.
See [Public API compatibility](ARCHITECTURE.md#public-api-compatibility) for
details on which API changes require a major release.


### Examples

You can see examples of each reCAPTCHA type in [examples/](examples/). You can
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.4.x-dev"
"dev-main": "1.5.x-dev"
}
},
"scripts": {
"lint": "vendor/bin/php-cs-fixer -vvv check --using-cache=no",
"lint-fix": "vendor/bin/php-cs-fixer -vvv fix --using-cache=no",
"phpstan": "vendor/bin/phpstan",
"test": "XDEBUG_MODE=coverage vendor/bin/phpunit",
"test": "@php -d xdebug.mode=coverage vendor/bin/phpunit",
"serve-examples": "@php -S localhost:8080 -t examples"
},
"config": {
Expand Down
74 changes: 37 additions & 37 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading