Test Setup Failed
Push — master ( 8f6b0a...c03d3f )
by Carsten
04:27 queued 12s
created

SalesmanAbstract::getEmail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Germania\Salesmen;
3
4
use Germania\Retailers\RetailerNumberInterceptorsTrait;
5
6
class SalesmanAbstract implements SalesmanInterface
7
{
8
    use RetailerNumberInterceptorsTrait,
9
        SalesmanIdAwareTrait;
10
11
    /**
12
     * @var string
13
     */
14
    public $first_name;
15
16
    /**
17
     * @var string
18
     */
19
    public $last_name;
20
21
    /**
22
     * @var string
23
     */
24
    public $email;
25
26
    /**
27
     * @var int
28
     */
29
    public $user_id;
30
31
    /**
32
     * @var int
33
     */
34
    public $is_active;
35
36
37
    /**
38
     * @return string
39
     */
40
    public function getFirstName()
41
    {
42
        return $this->first_name;
43
    }
44
45
46
    /**
47
     * @return string
48
     */
49
    public function getLastName()
50
    {
51
        return $this->last_name;
52
    }
53
54
55
    /**
56
     * @return string
57
     */
58
    public function getEmail()
59
    {
60
        return $this->email;
61
    }
62
63
64
    /**
65
     * @return string
66
     */
67
    public function getUserId() {
68
        return $this->user_id;
69
    }
70
71
72
    /**
73
     * @return bool
74
     */
75
    public function isActive() {
76
        return (bool) $this->is_active > 0;
77
    }
78
79
80
    /**
81
     * @return string
82
     */
83
    public function getFullName()
84
    {
85
        return trim( join(" ", array_filter([
86
            $this->getFirstName(),
87
            $this->getLastName()
88
        ])));
89
    }
90
91
92
    /**
93
     * @return string
94
     */
95
    public function getDisplayName()
96
    {
97
        return trim( join(" ∙ ", array_filter([
98
            $this->getFullName(),
99
            $this->getSalesmanId()
100
        ])));
101
    }
102
103
104
105
106
}
107