User   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 48
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fromData() 0 15 1
A contactMethods() 0 4 1
A __construct() 0 14 1
1
<?php
2
3
namespace Shrikeh\PagerDuty\Entity\User;
4
5
use Shrikeh\PagerDuty\Entity\User as UserInterface;
6
7
use Psr\Http\Message\UriInterface;
8
use Shrikeh\PagerDuty\Collection;
9
10
final class User implements UserInterface
11
{
12
    private $contactMethods;
13
14
    private $self;
15
16
    private $name;
17
18
    private $email;
19
20
    private $summary;
21
22
    public static function fromData(
23
        Collection $contactMethods,
24
        UriInterface $self,
25
        $name,
26
        $email,
27
        $summary
28
    ) {
29
        return new static(
30
            $contactMethods,
31
            $name,
32
            $email,
33
            $summary,
34
            $self
35
        );
36
    }
37
38
    public function contactMethods()
39
    {
40
        return $this->contactMethods;
41
    }
42
43
    private function __construct(
44
        Collection $contactMethods,
45
        $name,
46
        $email,
47
        $summary,
48
        UriInterface $self = null
49
    )
50
    {
0 ignored issues
show
Coding Style introduced by
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
Loading history...
51
        $this->contactMethods = $contactMethods;
52
        $this->name           = $name;
53
        $this->email          = $email;
54
        $this->summary        = $summary;
55
        $this->self           = $self;
56
    }
57
}
58