| Total Complexity | 5 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class AddLogMessage extends TdFunction |
||
| 15 | { |
||
| 16 | public const TYPE_NAME = 'addLogMessage'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * The minimum verbosity level needed for the message to be logged, 0-1023. |
||
| 20 | */ |
||
| 21 | protected int $verbosityLevel; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Text of a message to log. |
||
| 25 | */ |
||
| 26 | protected string $text; |
||
| 27 | |||
| 28 | public function __construct(int $verbosityLevel, string $text) |
||
| 29 | { |
||
| 30 | $this->verbosityLevel = $verbosityLevel; |
||
| 31 | $this->text = $text; |
||
| 32 | } |
||
| 33 | |||
| 34 | public static function fromArray(array $array): AddLogMessage |
||
| 35 | { |
||
| 36 | return new static( |
||
| 37 | $array['verbosity_level'], |
||
| 38 | $array['text'], |
||
| 39 | ); |
||
| 40 | } |
||
| 41 | |||
| 42 | public function typeSerialize(): array |
||
| 43 | { |
||
| 44 | return [ |
||
| 45 | '@type' => static::TYPE_NAME, |
||
| 46 | 'verbosity_level' => $this->verbosityLevel, |
||
| 47 | 'text' => $this->text, |
||
| 48 | ]; |
||
| 49 | } |
||
| 50 | |||
| 51 | public function getVerbosityLevel(): int |
||
| 52 | { |
||
| 53 | return $this->verbosityLevel; |
||
| 54 | } |
||
| 55 | |||
| 56 | public function getText(): string |
||
| 59 | } |
||
| 60 | } |
||
| 61 |