Completed
Pull Request — master (#47)
by Phecho
04:34
created

AddNoteCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
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\Note;
13
14
final class AddNoteCommand
15
{
16
    /**
17
     * The note description.
18
     *
19
     * @var string
20
     */
21
    public $description;
22
23
    /**
24
     * The note noteable_type.
25
     *
26
     * @var string
27
     */
28
    public $noteable_type;
29
30
    /**
31
     * The note noteable_id.
32
     *
33
     * @var int
34
     */
35
    public $noteable_id;
36
37
    /**
38
     * The issue user.
39
     *
40
     * @var int
41
     */
42
    public $author_id;
43
44
    /**
45
     * The issue project.
46
     *
47
     * @var int
48
     */
49
    public $project_id;
50
51
    /**
52
     * The validation rules.
53
     *
54
     * @var string[]
55
     */
56
    public $rules = [
57
        'description'   => 'required|string',
58
        'noteable_type' => 'required|string',
59
        'noteable_id'   => 'required|int',
60
        'author_id'     => 'int',
61
        'project_id'    => 'int',
62
    ];
63
64
    /**
65
     * Create a new add issue command instance.
66
     *
67
     * @param string $description
68
     * @param string $noteable_type
69
     * @param int    $noteable_id
70
     * @param int    $author_id
71
     * @param int    $project_id
72
     *
73
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
74
     */
75
    public function __construct($description, $noteable_type, $noteable_id, $author_id, $project_id)
76
    {
77
        $this->description = $description;
78
        $this->noteable_type = $noteable_type;
79
        $this->noteable_id = $noteable_id;
80
        $this->author_id = $author_id;
81
        $this->project_id = $project_id;
82
    }
83
}
84