Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 136-148 (lines=13) @@
133
     *
134
     * @return array
135
     */
136
    protected function getMessageDataForReopenIssue(Queue $queue)
137
    {
138
        $messageData = [];
139
        $messageData['changeByHeading'] = $queue->changeBy->fullname . ' reopened an issue';
140
        $statusNow = $this->issue
141
            ->tags()->with('parent')->get()->where('parent.name', Tag::GROUP_STATUS)->last();
142
        $messageData['changes']['status'] = [
143
            'was' => trans('tinyissue.closed'),
144
            'now' => ($statusNow ? $statusNow->fullname : ''),
145
        ];
146
147
        return $messageData;
148
    }
149
150
    /**
151
     * Returns message data belongs to closing an issue.
@@ 157-169 (lines=13) @@
154
     *
155
     * @return array
156
     */
157
    protected function getMessageDataForCloseIssue(Queue $queue)
158
    {
159
        $messageData = [];
160
        $messageData['changeByHeading'] = $queue->changeBy->fullname . ' closed an issue';
161
        $statusWas = $this->issue
162
            ->tags()->with('parent')->get()->where('parent.name', Tag::GROUP_STATUS)->last();
163
        $messageData['changes']['status'] = [
164
            'was' => ($statusWas ? $statusWas->fullname : ''),
165
            'now' => trans('tinyissue.closed'),
166
        ];
167
168
        return $messageData;
169
    }
170
171
    /**
172
     * Returns message data belongs to assigning an issue to a user.