Passed
Push — master ( 7e2e7e...9e4d3a )
by Aurimas
02:20
created

TdObject::getTdTypeName()   A

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
use JsonSerializable;
12
13
abstract class TdObject implements TdTypeSerializableInterface, JsonSerializable
14
{
15
    public const TYPE_NAME = '_tdObject';
16
17
    public ?string $tdExtra = null;
18
19
    public function getTdExtra(): ?string
20
    {
21
        return $this->tdExtra;
22
    }
23
24
    public function getTdTypeName(): string
25
    {
26
        return static::TYPE_NAME;
27
    }
28
29
    public function setTdExtra(?string $tdExtra): self
30
    {
31
        $this->tdExtra = $tdExtra;
32
33
        return $this;
34
    }
35
36
    public function jsonSerialize(): array
37
    {
38
        $output = [];
39
        if (null !== $this->tdExtra) {
40
            $output['@extra'] = $this->tdExtra;
41
        }
42
43
        return array_merge($output, $this->typeSerialize());
44
    }
45
}
46