Completed
Push — feature/pilot_information ( 13ff1e...cc067b )
by Laurent
01:46
created

Pilot   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 72
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A getName() 0 4 1
A getFirstname() 0 4 1
A getEmail() 0 4 1
A fromArray() 0 11 1
1
<?php
2
3
4
namespace FlightLog\Application\Pilot\ViewModel;
5
6
7
use FlightLog\Application\Common\ViewModel\ViewModel;
8
9
final class Pilot extends ViewModel
10
{
11
12
    /**
13
     * @var int
14
     */
15
    private $id;
16
17
    /**
18
     * @var string
19
     */
20
    private $name;
21
22
    /**
23
     * @var string
24
     */
25
    private $firstname;
26
27
    /**
28
     * @var string
29
     */
30
    private $email;
31
32
    /**
33
     * @return int
34
     */
35
    public function getId(): int
36
    {
37
        return $this->id;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function getName(): string
44
    {
45
        return $this->name;
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getFirstname(): string
52
    {
53
        return $this->firstname;
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function getEmail(): string
60
    {
61
        return $this->email;
62
    }
63
64
    /**
65
     * @param array $values
66
     *
67
     * @return mixed
68
     */
69
    public static function fromArray(array $values)
70
    {
71
        $pilot = new self();
72
73
        $pilot->id = $values['id'];
74
        $pilot->name = $values['name'];
75
        $pilot->firstname = $values['firstname'];
76
        $pilot->email = $values['email'];
77
78
        return $pilot;
79
    }
80
}