Code Duplication    Length = 13-17 lines in 4 locations

src/Time.php 4 locations

@@ 145-161 (lines=17) @@
142
    /**
143
     * @return mixed
144
     */
145
    public function getProjects()
146
    {
147
        $tempServices = ['toggl'];
148
        $projects = [];
149
150
/*
151
 * Temporary, only get the projects of Toggl
152
 * Later, we will get Harvest ones too
153
 */
154
        foreach ($tempServices as $service) {
155
            if ($this->isServiceActive($service) === true) {
156
                $projects = $this->getServiceProjects($service);
157
            }
158
        }
159
160
        return $projects;
161
    }
162
163
    /**
164
     * @return mixed
@@ 166-178 (lines=13) @@
163
    /**
164
     * @return mixed
165
     */
166
    public function getRecentTimers()
167
    {
168
        $tempServices = ['toggl'];
169
        $timers = [];
170
171
        foreach ($tempServices as $service) {
172
            if ($this->isServiceActive($service) === true) {
173
                $timers = array_merge($timers, $this->getRecentServiceTimers($service));
174
            }
175
        }
176
177
        return $timers;
178
    }
179
180
    /**
181
     * @param  $service
@@ 223-235 (lines=13) @@
220
    /**
221
     * @return mixed
222
     */
223
    public function getTags()
224
    {
225
        $tempServices = ['toggl'];
226
        $tags = [];
227
228
        foreach ($tempServices as $service) {
229
            if ($this->isServiceActive($service) === true) {
230
                $tags = array_merge($tags, $this->getServiceTags($service));
231
            }
232
        }
233
234
        return $tags;
235
    }
236
237
    /**
238
     * @return mixed
@@ 397-409 (lines=13) @@
394
    /**
395
     * @return string
396
     */
397
    public function syncOnlineDataToLocalCache()
398
    {
399
        $tempServices = ['toggl'];
400
        $message = '';
401
402
        foreach ($tempServices as $service) {
403
            if ($this->isServiceActive($service) === true) {
404
                $message .= $this->syncServiceOnlineDataToLocalCache($service);
405
            }
406
        }
407
408
        return $message;
409
    }
410
411
    /**
412
     * @return string