Code Duplication    Length = 10-12 lines in 2 locations

src/time.php 2 locations

@@ 78-89 (lines=12) @@
75
76
        $atLeastOneTimerDeleted = false;
77
78
        foreach ($this->implementedServicesForFeature('delete') as $service) {
79
            $functionName = 'delete' . ucfirst($service) . 'Timer';
80
81
            if (call_user_func_array(['AlfredTime', $functionName], [$timerId]) === true) {
82
                if ($timerId === $this->config->get('workflow', 'timer_' . $service . '_id')) {
83
                    $this->config->update('workflow', 'timer_' . $service . '_id', null);
84
                    $atLeastOneTimerDeleted = true;
85
                }
86
            }
87
88
            $message .= $this->getLastMessage() . "\r\n";
89
        }
90
91
        if ($atLeastOneTimerDeleted === true) {
92
            $this->config->update('workflow', 'is_timer_running', false);
@@ 341-350 (lines=10) @@
338
339
        $atLeastOneTimerDeleted = false;
340
341
        foreach ($this->servicesToUndo() as $service) {
342
            $functionName = 'delete' . ucfirst($service) . 'Timer';
343
344
            if (call_user_func_array(['AlfredTime', $functionName], [$this->config->get('workflow', 'timer_' . $service . '_id')]) === true) {
345
                $this->config->update('workflow', 'timer_' . $service . '_id', null);
346
                $atLeastOneTimerDeleted = true;
347
            }
348
349
            $message .= $this->getLastMessage() . "\r\n";
350
        }
351
352
        if ($atLeastOneTimerDeleted === true) {
353
            $this->config->update('workflow', 'is_timer_running', false);