CreateAdminUserDefinition::define()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace Deployee\Plugins\ShopwareTasks\Definitions;
4
5
use Deployee\Plugins\Deploy\Definitions\Parameter\ParameterCollection;
6
use Deployee\Plugins\Deploy\Definitions\Parameter\ParameterCollectionInterface;
7
use Deployee\Plugins\Deploy\Definitions\Tasks\TaskDefinitionInterface;
8
9
class CreateAdminUserDefinition implements TaskDefinitionInterface
10
{
11
    /**
12
     * @var string
13
     */
14
    private $email;
15
16
    /**
17
     * @var string
18
     */
19
    private $username;
20
21
    /**
22
     * @var string
23
     */
24
    private $password;
25
26
    /**
27
     * @var string
28
     */
29
    private $name;
30
31
    /**
32
     * @var string
33
     */
34
    private $locale;
35
36
    /**
37
     * CreateAdminUserDefinition constructor.
38
     * @param string $email
39
     * @param string $username
40
     * @param string $password
41
     * @param string $name
42
     * @param string $locale
43
     */
44
    public function __construct(string $email, string $username, string $password, string $name, string $locale = "en_GB")
45
    {
46
        $this->email = $email;
47
        $this->username = $username;
48
        $this->password = $password;
49
        $this->name = $name;
50
        $this->locale = $locale;
51
    }
52
53
    /**
54
     * @return ParameterCollectionInterface
55
     */
56
    public function define(): ParameterCollectionInterface
57
    {
58
        return new ParameterCollection(get_object_vars($this));
59
    }
60
}