protege-id/php-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

protege-id/php-client

最新稳定版本:1.2.0

Composer 安装命令:

composer require protege-id/php-client

包简介

ProtegeId PHP SDK

README 文档

README

ProtegeId Logo

ProtegeId PHP SDK

PHP SDK for integrating with the ProtegeId API (Age Verification).

codecov PHPStan PHP Version License: MIT

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\ConfigException for invalid configuration.
  • ProtegeId\Exceptions\ValidationException for invalid method input.
  • ProtegeId\Exceptions\ApiException for 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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固