UpdateIssueCommand::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 8
Ratio 100 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 8
loc 8
rs 9.4286
cc 1
eloc 6
nc 1
nop 5
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\Issue;
13
14
use Gitamin\Models\Issue;
15
16 View Code Duplication
final class UpdateIssueCommand
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...
17
{
18
    /**
19
     * The issue to update.
20
     *
21
     * @var \Gitamin\Models\Issue
22
     */
23
    public $issue;
24
25
    /**
26
     * The issue title.
27
     *
28
     * @var string
29
     */
30
    public $title;
31
32
    /**
33
     * The issue description.
34
     *
35
     * @var string
36
     */
37
    public $description;
38
39
    /**
40
     * The issue author.
41
     *
42
     * @var int
43
     */
44
    public $author_id;
45
46
    /**
47
     * The issue project.
48
     *
49
     * @var int
50
     */
51
    public $project_id;
52
53
    /**
54
     * The validation rules.
55
     *
56
     * @var string[]
57
     */
58
    public $rules = [
59
        'title' => 'string',
60
        'description' => 'string',
61
        'author_id' => 'int',
62
        'project_id' => 'int',
63
    ];
64
65
    /**
66
     * Create a new update issue command instance.
67
     *
68
     * @param \Gitamin\Models\Issue $issue
69
     * @param string                $title
70
     * @param string                $description
71
     * @param int                   $author_id
72
     * @param int                   $project_id
73
     */
74
    public function __construct(Issue $issue, $title, $description, $author_id, $project_id)
75
    {
76
        $this->issue = $issue;
77
        $this->title = $title;
78
        $this->description = $description;
79
        $this->author_id = $author_id;
80
        $this->project_id = $project_id;
81
    }
82
}
83