Completed
Push — master ( ceacae...8ed125 )
by Beñat
9s
created

InviteUserCommand::id()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the BenGorUser package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace BenGorUser\User\Application\Command\Invite;
14
15
use Ramsey\Uuid\Uuid;
16
17
/**
18
 * User invite command class.
19
 *
20
 * @author Beñat Espiña <[email protected]>
21
 */
22
class InviteUserCommand
23
{
24
    /**
25
     * The user id.
26
     *
27
     * @var string
28
     */
29
    private $id;
30
31
    /**
32
     * The user email.
33
     *
34
     * @var string
35
     */
36
    private $email;
37
38
    /**
39
     * Constructor.
40
     *
41
     * @param string      $anEmail The user email
42
     * @param string|null $anId    User id, it can be null
43
     */
44
    public function __construct($anEmail, $anId = null)
45
    {
46
        $this->id = null === $anId ? Uuid::uuid4()->toString() : $anId;
47
        $this->email = $anEmail;
48
    }
49
50
    /**
51
     * Gets the id.
52
     *
53
     * @return string
54
     */
55
    public function id()
56
    {
57
        return $this->id;
58
    }
59
60
    /**
61
     * Gets the user email.
62
     *
63
     * @return string
64
     */
65
    public function email()
66
    {
67
        return $this->email;
68
    }
69
}
70