User::setFirstName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Zored\Telegram\Entity;
6
7
use JMS\Serializer\Annotation as Serializer;
8
use Zored\Telegram\Entity\General\AbstractEntity;
9
10
class User extends AbstractEntity
11
{
12
    private const EXAMPLE = <<<JSON
13
{
14
  "_": "user",
15
  "self": false,
16
  "contact": true,
17
  "mutual_contact": false,
18
  "deleted": false,
19
  "bot": false,
20
  "bot_chat_history": false,
21
  "bot_nochats": false,
22
  "verified": false,
23
  "restricted": false,
24
  "min": false,
25
  "bot_inline_geo": false,
26
  "id": 123,
27
  "access_hash": 123,
28
  "first_name": "Ivan",
29
  "last_name": "Ivanov",
30
  "phone": "7534534535",
31
  "photo": {
32
    "_": "userProfilePhoto",
33
    "photo_id": 1,
34
    "photo_small": {
35
      "_": "fileLocation",
36
      "dc_id": 2,
37
      "volume_id": 1,
38
      "local_id": 1,
39
      "secret": -1
40
    },
41
    "photo_big": {
42
      "_": "fileLocation",
43
      "dc_id": 2,
44
      "volume_id": 1,
45
      "local_id": 1,
46
      "secret": -1
47
    }
48
  },
49
  "status": {
50
    "_": "userStatusRecently"
51
  }
52
}
53
JSON;
54
55
    /**
56
     * @Serializer\Type("integer")
57
     *
58
     * @var int
59
     */
60
    private $id;
61
62
    /**
63
     * @Serializer\Type("string")
64
     *
65
     * @var string
66
     */
67
    private $first_name;
68
69
    /**
70
     * @Serializer\Type("string")
71
     *
72
     * @var string
73
     */
74
    private $last_name;
75
76
    public function getId(): int
77
    {
78
        return $this->id;
79
    }
80
81
    public function setId(int $id): self
82
    {
83
        $this->id = $id;
84
85
        return $this;
86
    }
87
88
    public function getFullName(): string
89
    {
90
        return $this->first_name . ' ' . $this->last_name;
91
    }
92
93
    public function getFirstName(): string
94
    {
95
        return $this->first_name;
96
    }
97
98
    public function setFirstName(string $first_name): self
99
    {
100
        $this->first_name = $first_name;
101
102
        return $this;
103
    }
104
105
    public function getLastName(): string
106
    {
107
        return $this->last_name;
108
    }
109
110
    public function setLastName(string $last_name): self
111
    {
112
        $this->last_name = $last_name;
113
114
        return $this;
115
    }
116
}
117