AddGroupMemberCommand   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 57
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 0
dl 57
loc 57
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 7 7 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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