Code Duplication    Length = 14-14 lines in 2 locations

app/Model/Project/Note/SendMessages.php 1 location

@@ 55-68 (lines=14) @@
52
     *
53
     * @return Project
54
     */
55
    protected function getProject()
56
    {
57
        if ($this->getModel()) {
58
            return $this->getModel()->project;
59
        }
60
61
        // Possible deleted note
62
        if (null === $this->project) {
63
            $projectId     = $this->latestMessage->getDataFromPayload('origin.project_id');
64
            $this->project = (new Project())->find($projectId);
65
        }
66
67
        return $this->project;
68
    }
69
70
    /**
71
     * Returns the project id.

app/Model/Project/Issue/Comment/SendMessages.php 1 location

@@ 35-48 (lines=14) @@
32
     *
33
     * @return bool
34
     */
35
    protected function getIssue()
36
    {
37
        if (!$this->issue instanceof Issue) {
38
            if ($this->getModel()) {
39
                $this->issue = $this->getModel()->issue;
40
            } else {
41
                // Possible deleted comment
42
                $issueId     = $this->latestMessage->getDataFromPayload('origin.issue.id');
43
                $this->issue = (new Issue())->find($issueId);
44
            }
45
        }
46
47
        return $this->issue;
48
    }
49
50
    /**
51
     * Returns an instance of Project.