InputFileGenerated::getConversion()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This phpFile is auto-generated.
5
 */
6
7
declare(strict_types=1);
8
9
namespace AurimasNiekis\TdLibSchema;
10
11
/**
12
 * A file generated by the client.
13
 */
14
class InputFileGenerated extends InputFile
15
{
16
    public const TYPE_NAME = 'inputFileGenerated';
17
18
    /**
19
     * Local path to a file from which the file is generated; may be empty if there is no such file.
20
     *
21
     * @var string
22
     */
23
    protected string $originalPath;
24
25
    /**
26
     * String specifying the conversion applied to the original file; should be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage.
27
     *
28
     * @var string
29
     */
30
    protected string $conversion;
31
32
    /**
33
     * Expected size of the generated file; 0 if unknown.
34
     *
35
     * @var int
36
     */
37
    protected int $expectedSize;
38
39
    public function __construct(string $originalPath, string $conversion, int $expectedSize)
40
    {
41
        parent::__construct();
42
43
        $this->originalPath = $originalPath;
44
        $this->conversion   = $conversion;
45
        $this->expectedSize = $expectedSize;
46
    }
47
48
    public static function fromArray(array $array): InputFileGenerated
49
    {
50
        return new static(
51
            $array['original_path'],
52
            $array['conversion'],
53
            $array['expected_size'],
54
        );
55
    }
56
57
    public function typeSerialize(): array
58
    {
59
        return [
60
            '@type'         => static::TYPE_NAME,
61
            'original_path' => $this->originalPath,
62
            'conversion'    => $this->conversion,
63
            'expected_size' => $this->expectedSize,
64
        ];
65
    }
66
67
    public function getOriginalPath(): string
68
    {
69
        return $this->originalPath;
70
    }
71
72
    public function getConversion(): string
73
    {
74
        return $this->conversion;
75
    }
76
77
    public function getExpectedSize(): int
78
    {
79
        return $this->expectedSize;
80
    }
81
}
82