Code Duplication    Length = 13-15 lines in 3 locations

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

@@ 128-140 (lines=13) @@
125
     *
126
     * @return array
127
     */
128
    protected function getMessageDataForDeleteNote(Queue $queue)
129
    {
130
        $messageData                    = [];
131
        $messageData['changeByHeading'] = $queue->changeBy->fullname . ' deleted a note in ' . link_to($this->getProject()->to(), $this->getProject()->name);
132
        $messageData['changes']['note'] = [
133
            'noLabel' => true,
134
            'date'    => $queue->created_at,
135
            'was'     => \Html::format($queue->getDataFromPayload('origin.body')),
136
            'now'     => '',
137
        ];
138
139
        return $messageData;
140
    }
141
142
    /**
143
     * Return text to be used for the message heading.

app/Model/Project/Issue/Comment/SendMessages.php 2 locations

@@ 98-111 (lines=14) @@
95
     *
96
     * @return array
97
     */
98
    protected function getMessageDataForUpdateComment(Queue $queue)
99
    {
100
        $messageData                    = [];
101
        $messageData['changeByHeading'] = $queue->changeBy->fullname . ' updated a comment in ' . link_to($this->getIssue()->to(),
102
                '#' . $this->getIssue()->id);
103
        $messageData['changes']['comment'] = [
104
            'noLabel' => true,
105
            'date'    => $queue->getDataFromPayload('origin.updated_at'),
106
            'was'     => \Html::format($queue->getDataFromPayload('origin.comment')),
107
            'now'     => \Html::format($queue->getDataFromPayload('dirty.comment')),
108
        ];
109
110
        return $messageData;
111
    }
112
113
    /**
114
     * Returns message data belongs to deleting a note.
@@ 120-134 (lines=15) @@
117
     *
118
     * @return array
119
     */
120
    protected function getMessageDataForDeleteComment(Queue $queue)
121
    {
122
        $messageData                    = [];
123
        $messageData['changeByHeading'] = $queue->changeBy->fullname .
124
            ' deleted a comment from ' . link_to($this->getIssue()->to(), '#' . $this->getIssue()->id);
125
126
        $messageData['changes']['comment'] = [
127
            'noLabel' => true,
128
            'date'    => $queue->created_at,
129
            'was'     => \Html::format($queue->getDataFromPayload('origin.comment')),
130
            'now'     => '',
131
        ];
132
133
        return $messageData;
134
    }
135
136
    /**
137
     * Return text to be used for the message heading.