Code Duplication    Length = 11-11 lines in 3 locations

app/Handlers/Events/Comment/SendCommentMomentHandler.php 1 location

@@ 44-54 (lines=11) @@
41
     * @param \Gitamin\Models\Comment $comment
42
     * @param int                     $action
43
     */
44
    protected function trigger(Comment &$comment, $action)
45
    {
46
        $data = [
47
            'target_type' => 'Comment',
48
            'target_id' => $comment->id,
49
            'action' => $action,
50
            'author_id' => $comment->author_id,
51
            'project_id' => $comment->project_id,
52
        ];
53
        $moment = Moment::create($data);
54
    }
55
}
56

app/Handlers/Events/Project/SendProjectMomentHandler.php 1 location

@@ 47-57 (lines=11) @@
44
     * @param \Gitamin\Models\Project $project
45
     * @param int                     $action
46
     */
47
    protected function trigger(Project &$project, $action)
48
    {
49
        $data = [
50
            'target_type' => 'Project',
51
            'target_id' => $project->id,
52
            'action' => $action,
53
            'author_id' => $project->creator_id,
54
            'project_id' => $project->id,
55
        ];
56
        $moment = Moment::create($data);
57
    }
58
}
59

app/Handlers/Events/Owner/SendOwnerMomentHandler.php 1 location

@@ 44-54 (lines=11) @@
41
     * @param \Gitamin\Models\Comment $comment
42
     * @param int                     $action
43
     */
44
    protected function trigger(Owner &$owner, $action)
45
    {
46
        $data = [
47
            'target_type' => 'Owner',
48
            'target_id' => $owner->id,
49
            'action' => $action,
50
            'author_id' => $owner->user_id,
51
            'project_id' => 0,
52
        ];
53
        $moment = Moment::create($data);
54
    }
55
}
56