Completed
Push — master ( ebdf7a...2dba39 )
by Vladimir
05:12
created

User::getData()   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
declare(strict_types=1);
4
5
namespace FondBot;
6
7
use Illuminate\Support\Collection;
8
9
class User
10
{
11
    private $id;
12
    private $name;
13
    private $username;
14
    private $data;
15
16
    public function __construct(string $id, string $name = null, string $username = null, array $data = [])
17
    {
18
        $this->id = $id;
19
        $this->name = $name;
20
        $this->username = $username;
21
        $this->data = collect($data);
22
    }
23
24
    public function getId(): string
25
    {
26
        return $this->id;
27
    }
28
29
    public function getName(): ?string
30
    {
31
        return $this->name;
32
    }
33
34
    public function getUsername(): ?string
35
    {
36
        return $this->username;
37
    }
38
39
    /**
40
     * Additional user information.
41
     *
42
     * @return Collection
43
     */
44
    public function getData(): Collection
45
    {
46
        return $this->data;
47
    }
48
}
49