1 | <?php |
||
14 | final class AddMomentCommand |
||
15 | { |
||
16 | /** |
||
17 | * The moment title. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | public $title; |
||
22 | |||
23 | /** |
||
24 | * The moment data. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | public $data; |
||
29 | |||
30 | /** |
||
31 | * The moment target_type. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | public $target_type; |
||
36 | |||
37 | /** |
||
38 | * The moment target_id. |
||
39 | * |
||
40 | * @var int |
||
41 | */ |
||
42 | public $target_id; |
||
43 | |||
44 | /** |
||
45 | * The moment action. |
||
46 | * |
||
47 | * @var int |
||
48 | */ |
||
49 | public $action; |
||
50 | |||
51 | /** |
||
52 | * The moment user. |
||
53 | * |
||
54 | * @var int |
||
55 | */ |
||
56 | public $author_id; |
||
57 | |||
58 | /** |
||
59 | * The moment project. |
||
60 | * |
||
61 | * @var int |
||
62 | */ |
||
63 | public $project_id; |
||
64 | |||
65 | /** |
||
66 | * The validation rules. |
||
67 | * |
||
68 | * @var string[] |
||
69 | */ |
||
70 | public $rules = [ |
||
71 | 'target_type' => 'string', |
||
72 | 'target_id' => 'int', |
||
73 | 'action' => 'required|int', |
||
74 | 'author_id' => 'required|int', |
||
75 | 'project_id' => 'int', |
||
76 | ]; |
||
77 | |||
78 | /** |
||
79 | * Create a new add moment command instance. |
||
80 | * |
||
81 | * @param string $title |
||
82 | * @param string $data |
||
83 | * @param string $target_type |
||
84 | * @param int $target_id |
||
85 | * @param int $action |
||
86 | * @param int $author_id |
||
87 | * @param int $project_id |
||
88 | * |
||
89 | * @return void |
||
|
|||
90 | */ |
||
91 | public function __construct($title, $data, $target_type, $target_id, $action, $author_id, $project_id) |
||
101 | } |
||
102 |
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.