Completed
Push — master ( f3e44e...1f022d )
by Vladimir
02:48
created

User   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 40
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0
wmc 5
lcom 0
cbo 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getId() 0 4 1
A getName() 0 4 1
A getUsername() 0 4 1
A getData() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Channels;
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 32
    public function __construct(string $id, string $name = null, string $username = null, array $data = [])
17
    {
18 32
        $this->id = $id;
19 32
        $this->name = $name;
20 32
        $this->username = $username;
21 32
        $this->data = collect($data);
22 32
    }
23
24 4
    public function getId(): string
25
    {
26 4
        return $this->id;
27
    }
28
29 2
    public function getName(): ?string
30
    {
31 2
        return $this->name;
32
    }
33
34 2
    public function getUsername(): ?string
35
    {
36 2
        return $this->username;
37
    }
38
39
    /**
40
     * Additional user information.
41
     *
42
     * @return Collection
43
     */
44 1
    public function getData(): Collection
45
    {
46 1
        return $this->data;
47
    }
48
}
49