Skip to content

PSR standards

The codebase follows PSR-1 fundamentals for PHP files and class structure.

PSR-2 is superseded by PSR-12; this project follows PSR-12.

The SDK uses PSR-4 autoloading for the SolveBeam\Twinfield\ namespace, configured in composer.json.

Examples use PSR-6 caching for token storage via symfony/cache.

The OAuth2 provider relies on PSR-7 request/response interfaces for HTTP messages.

The library can work with PSR-18 HTTP clients. Suggested implementations are listed in composer.json (e.g., symfony/http-client, php-http/curl-client) along with a PSR-7 implementation such as nyholm/psr7.

Coding style follows PSR-12, enforced via the PHPCS ruleset in phpcs.xml.dist.