Code Duplication    Length = 16-17 lines in 2 locations

src/Menus/ChooseProject.php 1 location

@@ 40-55 (lines=16) @@
37
            ->arg('choose_tag');
38
    }
39
40
    private static function getServiceProjects($service)
41
    {
42
        $projects = [];
43
44
        foreach ($service->projects() as $id => $name) {
45
            $projects[] = Item::create()
46
                ->title($name)
47
                ->variable('timer_project_id', $id)
48
                ->variable('timer_project_name', $name)
49
                ->match($name)
50
                ->arg('choose_tag')
51
                ->icon(Icon::create("resources/icons/$service.png"));
52
        }
53
54
        return $projects;
55
    }
56
}
57

src/Menus/ChooseTag.php 1 location

@@ 41-57 (lines=17) @@
38
            ->variable('timer_action', 'start');
39
    }
40
41
    private static function getServiceTags($service)
42
    {
43
        $tags = [];
44
45
        foreach ($service->tags() as $id => $name) {
46
            $tags[] = Item::create()
47
                ->title($name)
48
                ->variable('timer_tag', $name)
49
                ->variable('timer_tag_id', $id)
50
                ->match($name)
51
                ->icon(Icon::create("resources/icons/$service.png"))
52
                ->arg('do')
53
                ->variable('timer_action', 'start');
54
        }
55
56
        return $tags;
57
    }
58
}
59