Completed
Push — master ( 434bf1...28f331 )
by Phecho
03:35
created

AddCommentCommand::__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 0
Metric Value
c 1
b 0
f 0
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\Comment;
13
14
final class AddCommentCommand
15
{
16
    /**
17
     * The comment message.
18
     *
19
     * @var string
20
     */
21
    public $message;
22
23
    /**
24
     * The comment target_type.
25
     *
26
     * @var string
27
     */
28
    public $target_type;
29
30
    /**
31
     * The comment target_id.
32
     *
33
     * @var int
34
     */
35
    public $target_id;
36
37
    /**
38
     * The comment user.
39
     *
40
     * @var int
41
     */
42
    public $author_id;
43
44
    /**
45
     * The comment 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
        'message'     => 'required|string',
58
        'target_type' => 'required|string',
59
        'target_id'   => 'required|int',
60
        'author_id'   => 'int',
61
        'project_id'  => 'int',
62
    ];
63
64
    /**
65
     * Create a new add comment command instance.
66
     *
67
     * @param string $message
68
     * @param string $target_type
69
     * @param int    $target_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($message, $target_type, $target_id, $author_id, $project_id)
76
    {
77
        $this->message = $message;
78
        $this->target_type = $target_type;
79
        $this->target_id = $target_id;
80
        $this->author_id = $author_id;
81
        $this->project_id = $project_id;
82
    }
83
}
84