Code Duplication    Length = 9-10 lines in 2 locations

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

@@ 247-255 (lines=9) @@
244
     *
245
     * @return void
246
     */
247
    protected function populateData()
248
    {
249
        $this->issue->setRelation('assigned', $this->getUserById($this->issue->assigned_to));
250
        $creator = $this->getUserById($this->issue->created_by);
251
        if ($creator) {
252
            $this->issue->setRelation('user', $creator);
253
        }
254
        $this->loadIssueCreatorToProjectUsers();
255
    }
256
257
    /**
258
     * Check if the latest message is about closing or reopening an issue.

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

@@ 166-175 (lines=10) @@
163
     *
164
     * @return void
165
     */
166
    protected function populateData()
167
    {
168
        // Set the relation of assigned in issue object from the fetch data
169
        $this->issue->setRelation('assigned', $this->getUserById($this->issue->assigned_to));
170
        $creator = $this->getUserById($this->issue->created_by);
171
        if ($creator) {
172
            $this->issue->setRelation('user', $creator);
173
        }
174
        $this->loadIssueCreatorToProjectUsers();
175
    }
176
177
    /**
178
     * Check if the latest message is about deleting a comment.