PHP code example of layas / tdlib-schema

1. Go to this page and download the library: Download layas/tdlib-schema library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

layas / tdlib-schema example snippets




use AurimasNiekis\TdLibSchema\TdSchemaRegistry;

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

TdSchemaRegistry::fromArray($input);

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



use AurimasNiekis\TdLibSchema\TdSchemaRegistry;

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

TdSchemaRegistry::fromArray($input);

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