Completed
Push — master ( 2a94c4...b12f66 )
by Rémi
03:28
created

CreateUserCommand::getPreferredLanguage()   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 string
20
     */
21
    private $preferredLanguage;
22
23
    /**
24
     * @var Context
25
     */
26
    private $context;
27
28
    /**
29
     * Constructor.
30
     */
31 3
    public function __construct()
32
    {
33 3
    }
34
35
    /**
36
     * Returns the command name
37
     *
38
     * @return string
39
     */
40 3
    public function getCommandName()
41
    {
42 3
        return self::NAME;
43
    }
44
45
    /**
46
     * Returns the user
47
     *
48
     * @return object
49
     */
50 3
    public function getOriginalUser()
51
    {
52 3
        return $this->originalUser;
53
    }
54
55
    /**
56
     * @return string
57
     */
58 3
    public function getPreferredLanguage()
59
    {
60 3
        return $this->preferredLanguage;
61
    }
62
63
    /**
64
     * Returns the context
65
     *
66
     * @return Context
67
     */
68 3
    public function getContext()
69
    {
70 3
        return $this->context;
71
    }
72
73
    /**
74
     * Static constructor.
75
     *
76
     * @param object  $originalUser
77
     * @param string  $preferredLanguage
78
     * @param Context $context
79
     *
80
     * @return CreateUserCommand
81
     */
82 3
    public static function create($originalUser, $preferredLanguage, Context $context = null)
83
    {
84 3
        $obj = new self();
85
86 3
        $obj->originalUser = $originalUser;
87 3
        $obj->preferredLanguage = $preferredLanguage;
88 3
        $obj->context = $context;
89
90 3
        return $obj;
91
    }
92
}
93