protege-id/php-client
最新稳定版本:1.2.0
Composer 安装命令:
composer require protege-id/php-client
包简介
ProtegeId PHP SDK
README 文档
README
ProtegeId PHP SDK
PHP SDK for integrating with the ProtegeId API (Age Verification).
Requirements
- PHP 8.0+
Installation
composer require protege-id/php-client
Basic usage
<?php use ProtegeId\ProtegeIdClient; use ProtegeId\Exceptions\ApiException; use ProtegeId\Exceptions\ConfigException; use ProtegeId\Exceptions\ValidationException; try { $client = new ProtegeIdClient('your-api-key'); $session = $client->createSession( userRef: 'user-123', returnUrl: 'https://yoursite.com/path-to-return', metadata: ['additional' => 'infos'] ); $verification = $client->verifySession('user-123'); } catch (ValidationException | ConfigException | ApiException $e) { echo $e::class . ': ' . $e->getMessage() . PHP_EOL; }
Exceptions
ProtegeId\Exceptions\ConfigExceptionfor invalid configuration.ProtegeId\Exceptions\ValidationExceptionfor invalid method input.ProtegeId\Exceptions\ApiExceptionfor API errors.
Testing and code quality
Run the test suite:
./vendor/bin/phpunit
Run the PHPCS code style checks:
./vendor/bin/phpcs
Run the PHPStan static analysis:
vendor/bin/phpstan analyse
Generate code coverage (requires Xdebug or PCOV enabled):
composer test:coverage
The HTML report is generated in build/coverage/.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Support
For questions, issues, or to request an API key, please contact:
ProtegeId Sales Team Email: vendas@protegeid.com.br
For bug reports and feature requests, please use the GitHub Issues page.
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-27
