AppUser   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 44
rs 10
ccs 8
cts 8
cp 1
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A id() 0 3 1
A __construct() 0 4 1
A email() 0 3 1
1
<?php
2
/**
3
 * @author Tharanga Kothalawala <[email protected]>
4
 * @date 30-12-2018
5
 */
6
7
namespace TSK\SSO\AppUser;
8
9
/**
10
 * @package TSK\SSO\AppUser
11
 *
12
 * This represents a user within the client application with their basic data.
13
 */
14
abstract class AppUser
15
{
16
    /**
17
     * @var string
18
     */
19
    private $id;
20
21
    /**
22
     * @var string
23
     */
24
    private $email;
25
26
    /**
27
     * @param string $id the unique id of the application's user entity. ex: a UUID
28
     * @param string $email the email address of the application's user entity
29
     */
30 10
    public function __construct($id, $email)
31
    {
32 10
        $this->id = $id;
33 10
        $this->email = $email;
34 10
    }
35
36
    /**
37
     * @return string
38
     */
39 10
    public function id()
40
    {
41 10
        return $this->id;
42
    }
43
44
    /**
45
     * @return string
46
     */
47 8
    public function email()
48
    {
49 8
        return $this->email;
50
    }
51
52
    /**
53
     * Returns true if this user is an existing user or newly created one.
54
     *
55
     * @return bool
56
     */
57
    abstract public function isExistingUser();
58
}
59