AddMomentCommand   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 86
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 1
c 2
b 0
f 2
lcom 0
cbo 0
dl 0
loc 86
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
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\Moment;
13
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
    public function __construct($title, $data, $target_type, $target_id, $action, $author_id, $project_id)
90
    {
91
        $this->title = $title;
92
        $this->data = $data;
93
        $this->target_type = $target_type;
94
        $this->target_id = $target_id;
95
        $this->action = $action;
96
        $this->author_id = $author_id;
97
        $this->project_id = $project_id;
98
    }
99
}
100