AddGroupMemberCommand::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 7
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 7
loc 7
rs 9.4286
cc 1
eloc 5
nc 1
nop 4
1
<?php
2
3
/*
4
 * This file is part of Gitamin.
5
 *
6
 * Copyright (C) 2015-2016 The Gitamin Team
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Gitamin\Commands\User;
13
14 View Code Duplication
final class AddGroupMemberCommand
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
{
16
    /**
17
     * The user username.
18
     *
19
     * @var string
20
     */
21
    public $username;
22
23
    /**
24
     * The user password.
25
     *
26
     * @var string
27
     */
28
    public $password;
29
30
    /**
31
     * The user email.
32
     *
33
     * @var string
34
     */
35
    public $email;
36
37
    /**
38
     * The user level.
39
     *
40
     * @var int
41
     */
42
    public $level;
43
44
    /**
45
     * The validation rules.
46
     *
47
     * @var string[]
48
     */
49
    public $rules = [
50
        'name' => 'required|string',
51
        'password' => 'string',
52
        'level' => 'int',
53
    ];
54
55
    /**
56
     * Create a new add group member command instance.
57
     *
58
     * @param string $username
59
     * @param string $password
60
     * @param string $email
61
     * @param int    $level
62
     */
63
    public function __construct($username, $password, $email, $level)
64
    {
65
        $this->username = $username;
66
        $this->password = $password;
67
        $this->email = $email;
68
        $this->level = $level;
69
    }
70
}
71