Code Duplication    Length = 16-16 lines in 2 locations

src/Services/Harvest.php 1 location

@@ 89-104 (lines=16) @@
86
        return $timer['id'];
87
    }
88
89
    public function stopCurrentTimer()
90
    {
91
        if ($timerId = $this->runningTimer()) {
92
            $timer = $this->client->timeEntries()->stop($timerId);
93
94
            if (! isset($timer['id'])) {
95
                throw new \Exception("Can't stop current running timer.", 1);
96
97
                return false;
98
            }
99
100
            return true;
101
        }
102
103
        return false;
104
    }
105
106
    public function runningTimer()
107
    {

src/Services/Toggl.php 1 location

@@ 65-80 (lines=16) @@
62
        return $timer->id;
63
    }
64
65
    public function stopCurrentTimer()
66
    {
67
        if ($timerId = $this->runningTimer()) {
68
            $response = $this->client->stopTimeEntry($timerId);
69
70
            if (! isset($response->id)) {
71
                throw new Exception("Can't stop current running timer.", 1);
72
73
                return false;
74
            }
75
76
            return true;
77
        }
78
79
        return false;
80
    }
81
82
    public function runningTimer()
83
    {