1 | <?php |
||
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 |
||
|
|||
74 | */ |
||
75 | public function __construct($message, $target_type, $target_id, $author_id, $project_id) |
||
83 | } |
||
84 |
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.