Code Duplication    Length = 11-11 lines in 3 locations

src/Http/Api/IssueController.php 1 location

@@ 1651-1661 (lines=11) @@
1648
        $options = [ 'w2d' => 5, 'd2h' => 8 ];
1649
1650
        $setting = SysSetting::first();
1651
        if ($setting && isset($setting->properties)) {
1652
            if (isset($setting->properties['week2day'])) {
1653
                $options['w2d'] = $setting->properties['week2day'];
1654
            }
1655
            if (isset($setting->properties['day2hour'])) {
1656
                $options['d2h'] = $setting->properties['day2hour'];
1657
            }
1658
        }
1659
        return $options;
1660
    }
1661
1662
    /**
1663
     * get issue link relations.
1664
     *

src/Http/Api/TimeTrackTrait.php 2 locations

@@ 48-58 (lines=11) @@
45
        $W2D = 5;
46
        $D2H = 8;
47
        $setting = SysSetting::first();
48
        if ($setting && isset($setting->properties)) {
49
            if (isset($setting->properties['week2day'])) {
50
                $W2D = $setting->properties['week2day'];
51
            }
52
            if (isset($setting->properties['day2hour'])) {
53
                $D2H = $setting->properties['day2hour'];
54
            }
55
        }
56
        $W2M = $W2D * $D2H * 60;
57
        $D2M = $D2H * 60;
58
        $H2M = 60;
59
        $tt_in_min = 0;
60
        $ttString = strtolower(trim($ttString));
61
        $ttValues = explode(' ', $ttString);
@@ 99-109 (lines=11) @@
96
        $W2D = 5;
97
        $D2H = 8;
98
        $setting = SysSetting::first();
99
        if ($setting && isset($setting->properties)) {
100
            if (isset($setting->properties['week2day'])) {
101
                $W2D = $setting->properties['week2day'];
102
            }
103
            if (isset($setting->properties['day2hour'])) {
104
                $D2H = $setting->properties['day2hour'];
105
            }
106
        }
107
        $W2M = $W2D * $D2H * 60;
108
        $D2M = $D2H * 60;
109
        $H2M = 60;
110
        $tt_in_min = 0;
111
        $ttString = strtolower(trim($ttString));
112
        $ttValues = explode(' ', $ttString);