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

TdObject   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getTdExtra() 0 3 1
A jsonSerialize() 0 8 2
A setTdExtra() 0 5 1
A getTdTypeName() 0 3 1
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