承接 phptdgram/schema 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

phptdgram/schema

Composer 安装命令:

composer require phptdgram/schema

包简介

The PHP TD Gram Schema generated TdLib Schema Classes using phptdgram/schema-generator from td_api.tl file.

README 文档

README

Latest Version on Packagist Software License Build Status Code Quality Total Downloads

Email

The PHP TD Gram Schema generated TdLib Schema Classes using phptdgram/schema-generator from td_api.tl file.

Based on TdLib td_api v1.6.0 schema version

Install

Via Composer

$ composer require phptdgram/schema

Usage

<?php

use PHPTdGram\Schema\TdSchemaRegistry;

$input = [
    '@type' => 'updateOption',
    'name' => 'version',
    'value' => [
        '@type' => 'optionValueString',
        'value' => '1.6.0',
    ],
];

TdSchemaRegistry::fromArray($input);

Will parse TdLib response to PHP Objects

class PHPTdGram\Schema\UpdateOption#3 (3) {
  protected string $name =>
  string(7) "version"
  protected PHPTdGram\Schema\OptionValue $value =>
  class PHPTdGram\Schema\OptionValueString#2 (2) {
    protected string $value =>
    string(5) "1.6.0"
    public ?string $tdExtra =>
    NULL
  }
  public ?string $tdExtra =>
  NULL
}

Another example:

<?php

use PHPTdGram\Schema\TdSchemaRegistry;

$input = [
    '@extra' => 'foo',
    '@type' => 'updateAuthorizationState',
    'authorization_state' => [
        '@type' => 'authorizationStateWaitTdlibParameters',
    ],
];

TdSchemaRegistry::fromArray($input);

Will produce:

class PHPTdGram\Schema\UpdateAuthorizationState#3 (2) {
  protected PHPTdGram\Schema\AuthorizationState $authorizationState =>
  class PHPTdGram\Schema\AuthorizationStateWaitTdlibParameters#2 (1) {
    public ?string $tdExtra =>
    NULL
  }
  public ?string $tdExtra =>
  string(3) "foo"
}

Testing

Run PHP style checker

$ composer cs-check

Run PHP style fixer

$ composer cs-fix

Run all continuous integration tests

$ composer ci-run

Contributing

Please see CONTRIBUTING and CONDUCT for details.

License

Please see License File for more information.

统计信息

  • 总下载量: 134
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固