| Total Complexity | 10 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Coverage | 97.37% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class Entrance extends Menu |
||
| 12 | { |
||
| 13 | 38 | public static function scriptFilter() |
|
| 18 | ); |
||
| 19 | 38 | } |
|
| 20 | |||
| 21 | 38 | private static function timerAction() |
|
| 22 | { |
||
| 23 | 38 | $serviceEnabled = Workflow::serviceEnabled(); |
|
| 24 | |||
| 25 | 38 | if (! $serviceEnabled) { |
|
| 26 | 18 | return; |
|
| 27 | } |
||
| 28 | |||
| 29 | 20 | if ($serviceEnabled->runningTimer()) { |
|
| 30 | 2 | return self::stopCurrentTimer(); |
|
| 31 | } |
||
| 32 | |||
| 33 | 18 | return self::startTimer(); |
|
| 34 | } |
||
| 35 | |||
| 36 | 2 | private static function stopCurrentTimer() |
|
| 44 | } |
||
| 45 | |||
| 46 | 18 | private static function startTimer() |
|
| 47 | { |
||
| 48 | 18 | if (! empty(Workflow::serviceEnabled())) { |
|
| 49 | 18 | return Item::create() |
|
| 50 | 18 | ->uid('start_timer') |
|
| 51 | 18 | ->title('Start "' . self::userInput() . '"') |
|
| 52 | 18 | ->mod( |
|
| 53 | 18 | Cmd::create() |
|
| 54 | 18 | ->subtitle('Continue a timer') |
|
| 55 | 18 | ->arg('choose_timer') |
|
| 56 | ) |
||
| 57 | 18 | ->arg('choose_project') |
|
| 58 | 18 | ->variable('timer_description', self::userInput()); |
|
| 59 | } |
||
| 60 | } |
||
| 61 | |||
| 62 | 38 | private static function setupWorkflow() |
|
| 70 | } |
||
| 71 | 6 | } |
|
| 73 |