Code Duplication    Length = 13-15 lines in 3 locations

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

@@ 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.

app/Model/Project/Note/SendMessages.php 2 locations

@@ 107-119 (lines=13) @@
104
     *
105
     * @return array
106
     */
107
    protected function getMessageDataForUpdateNote(Queue $queue)
108
    {
109
        $messageData                    = [];
110
        $messageData['changeByHeading'] = $queue->changeBy->fullname . ' updated a note in ' . link_to($this->getProject()->to(), $this->getProject()->name);
111
        $messageData['changes']['note'] = [
112
            'noLabel' => true,
113
            'date'    => $queue->getDataFromPayload('origin.updated_at'),
114
            'was'     => \Html::format($queue->getDataFromPayload('origin.body')),
115
            'now'     => \Html::format($queue->getDataFromPayload('dirty.body')),
116
        ];
117
118
        return $messageData;
119
    }
120
121
    /**
122
     * Returns message data belongs to deleting a note.
@@ 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.