Total Complexity | 4 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 50% |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
7 | class Cursor |
||
8 | { |
||
9 | /** |
||
10 | * Show cursor sequence |
||
11 | * |
||
12 | * @return string |
||
13 | */ |
||
14 | 1 | public static function show(): string |
|
15 | { |
||
16 | 1 | return ConsoleColor::ESC_CHAR . '[?25h' . ConsoleColor::ESC_CHAR . '[?0c'; |
|
17 | } |
||
18 | |||
19 | /** |
||
20 | * Hide cursor sequence |
||
21 | * |
||
22 | * @return string |
||
23 | */ |
||
24 | 1 | public static function hide(): string |
|
27 | } |
||
28 | |||
29 | /** |
||
30 | * Move up cursor sequence |
||
31 | * |
||
32 | * @param int $rows |
||
33 | * @return string |
||
34 | */ |
||
35 | public static function up(int $rows = 1): string |
||
36 | { |
||
37 | return ConsoleColor::ESC_CHAR . "[{$rows}A"; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Move down cursor sequence |
||
42 | * |
||
43 | * @param int $rows |
||
44 | * @return string |
||
45 | */ |
||
46 | public static function down(int $rows = 1): string |
||
49 | } |
||
50 | } |
||
51 |