Completed
Push — master ( 608d8b...b7ceed )
by Tharanga
06:16
created

AppUser::isExistingUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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
    public function __construct($id, $email)
31
    {
32
        $this->id = $id;
33
        $this->email = $email;
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function id()
40
    {
41
        return $this->id;
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function email()
48
    {
49
        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