Code Duplication    Length = 7-7 lines in 2 locations

app/Services/Action/TaskCloseNoActivity.php 1 location

@@ 75-81 (lines=7) @@
72
        $results = [];
73
        $max = $this->getParam('duration') * 86400;
74
75
        foreach ($data['tasks'] as $task) {
76
            $duration = time() - $task['date_modification'];
77
78
            if ($duration > $max) {
79
                $results[] = $this->taskStatusModel->close($task['id']);
80
            }
81
        }
82
83
        return in_array(true, $results, true);
84
    }

app/Services/Action/TaskEmailNoActivity.php 1 location

@@ 93-99 (lines=7) @@
90
        $user = $this->userModel->getById($this->getParam('user_id'));
91
92
        if (!empty($user['email'])) {
93
            foreach ($data['tasks'] as $task) {
94
                $duration = time() - $task['date_modification'];
95
96
                if ($duration > $max) {
97
                    $results[] = $this->sendEmail($task['id'], $user);
98
                }
99
            }
100
        }
101
102
        return in_array(true, $results, true);