Completed
Push — master ( 815ce9...9cb95e )
by Rémi
03:55
created

CreateUserCommand::getContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace MessageApp\Command;
4
5
use League\Tactician\Plugins\NamedCommand\NamedCommand;
6
use RemiSan\Context\Context;
7
use RemiSan\Context\ContextAware;
8
9
class CreateUserCommand implements NamedCommand, ContextAware
10
{
11
    const NAME = 'USER.CREATE';
12
13
    /**
14
     * @var object
15
     */
16
    private $originalUser;
17
18
    /**
19
     * @var Context
20
     */
21
    private $context;
22
23
    /**
24
     * Constructor.
25
     */
26 3
    public function __construct()
27
    {
28 3
    }
29
30
    /**
31
     * Returns the command name
32
     *
33
     * @return string
34
     */
35 3
    public function getCommandName()
36
    {
37 3
        return self::NAME;
38
    }
39
40
    /**
41
     * Returns the user
42
     *
43
     * @return object
44
     */
45 3
    public function getOriginalUser()
46
    {
47 3
        return $this->originalUser;
48
    }
49
50
    /**
51
     * Returns the context
52
     *
53
     * @return Context
54
     */
55 3
    public function getContext()
56
    {
57 3
        return $this->context;
58
    }
59
60
    /**
61
     * Static constructor.
62
     *
63
     * @param object  $originalUser
64
     * @param Context $context
65
     *
66
     * @return CreateUserCommand
67
     */
68 3
    public static function create($originalUser, Context $context = null)
69
    {
70 3
        $obj = new self();
71
72 3
        $obj->originalUser = $originalUser;
73 3
        $obj->context = $context;
74
75 3
        return $obj;
76
    }
77
}
78