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

CreateUserCommand   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 1
Metric Value
wmc 5
c 4
b 0
f 1
lcom 1
cbo 0
dl 0
loc 69
ccs 13
cts 13
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getCommandName() 0 4 1
A getOriginalUser() 0 4 1
A create() 0 9 1
A getContext() 0 4 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