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

User   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getUsername() 0 3 1
A getName() 0 3 1
A __construct() 0 6 1
A getId() 0 3 1
A getData() 0 3 1
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