| Total Complexity | 4 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class SetNetworkType extends TdFunction |
||
| 15 | { |
||
| 16 | public const TYPE_NAME = 'setNetworkType'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * The new network type. By default, networkTypeOther. |
||
| 20 | * |
||
| 21 | * @var NetworkType |
||
| 22 | */ |
||
| 23 | protected NetworkType $type; |
||
| 24 | |||
| 25 | public function __construct(NetworkType $type) |
||
| 26 | { |
||
| 27 | $this->type = $type; |
||
| 28 | } |
||
| 29 | |||
| 30 | public static function fromArray(array $array): SetNetworkType |
||
| 31 | { |
||
| 32 | return new static( |
||
| 33 | TdSchemaRegistry::fromArray($array['type']), |
||
| 34 | ); |
||
| 35 | } |
||
| 36 | |||
| 37 | public function typeSerialize(): array |
||
| 42 | ]; |
||
| 43 | } |
||
| 44 | |||
| 45 | public function getType(): NetworkType |
||
| 50 |