@@ 14-73 (lines=60) @@ | ||
11 | ||
12 | namespace Gitamin\Commands\Issue; |
|
13 | ||
14 | final class AddIssueCommand |
|
15 | { |
|
16 | /** |
|
17 | * The issue title. |
|
18 | * |
|
19 | * @var string |
|
20 | */ |
|
21 | public $title; |
|
22 | ||
23 | /** |
|
24 | * The issue description. |
|
25 | * |
|
26 | * @var string |
|
27 | */ |
|
28 | public $description; |
|
29 | ||
30 | /** |
|
31 | * The issue user. |
|
32 | * |
|
33 | * @var int |
|
34 | */ |
|
35 | public $author_id; |
|
36 | ||
37 | /** |
|
38 | * The issue project. |
|
39 | * |
|
40 | * @var int |
|
41 | */ |
|
42 | public $project_id; |
|
43 | ||
44 | /** |
|
45 | * The validation rules. |
|
46 | * |
|
47 | * @var string[] |
|
48 | */ |
|
49 | public $rules = [ |
|
50 | 'title' => 'required|string', |
|
51 | 'description' => 'string', |
|
52 | 'author_id' => 'int', |
|
53 | 'project_id' => 'int', |
|
54 | ]; |
|
55 | ||
56 | /** |
|
57 | * Create a new add issue command instance. |
|
58 | * |
|
59 | * @param string $title |
|
60 | * @param string $description |
|
61 | * @param int $author_id |
|
62 | * @param int $project_id |
|
63 | */ |
|
64 | public function __construct($title, $description, $author_id, $project_id) |
|
65 | { |
|
66 | $this->title = $title; |
|
67 | $this->description = $description; |
|
68 | $this->author_id = $author_id; |
|
69 | $this->project_id = $project_id; |
|
70 | } |
|
71 | } |
|
72 |
@@ 16-84 (lines=69) @@ | ||
13 | ||
14 | use Gitamin\Models\Issue; |
|
15 | ||
16 | final class UpdateIssueCommand |
|
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 |