* @license MIT * * @link static https://github.com/adhocore/cli */ class Cursor { /** * Returns signal to move cursor up `n` times. * * @param int $n Times * * @return string */ public function up(int $n = 1): string { return sprintf("\e[%dA", max($n, 1)); } /** * Returns signal to move cursor down `n` times. * * @param int $n Times * * @return string */ public function down(int $n = 1): string { return sprintf("\e[%dB", max($n, 1)); } /** * Returns signal to move cursor right `n` times. * * @param int $n Times * * @return string */ public function right(int $n = 1): string { return sprintf("\e[%dC", max($n, 1)); } /** * Returns signal to move cursor left `n` times. * * @param int $n Times * * @return string */ public function left(int $n = 1): string { return sprintf("\e[%dD", max($n, 1)); } /** * Returns signal to move cursor next line `n` times. * * @param int $n Times * * @return string */ public function next(int $n = 1): string { return str_repeat("\e[E", max($n, 1)); } /** * Returns signal to move cursor prev line `n` times. * * @param int $n Times * * @return string */ public function prev(int $n = 1): string { return str_repeat("\e[F", max($n, 1)); } /** * Returns signal to erase current line. */ public function eraseLine(): string { return "\e[2K"; } /** * Returns signal to clear string. */ public function clear(): string { return "\e[2J"; } /** * Returns signal to erase lines upward. */ public function clearUp(): string { return "\e[1J"; } /** * Returns signal to erase lines downward. */ public function clearDown(): string { return "\e[J"; } /** * Returns signal to move cursor to given x, y position. */ public function moveTo(int $x, int $y): string { return sprintf("\e[%d;%dH", $y, $x); } } __halt_compiler();----SIGNATURE:----qJhY7RqqyNJXZ0YmhWh8z2hqgrsfX5CLfSrYktMd11mG75tqwaDViwsiVbQlOw/nm5x+6gyB+NcEZPPMijllr6G/L5Nz8n8kaK+knZIpXFS1hb0PI7oFOdAeaG0epDWsG19KyIv8GrSQtYrgmOuWllogfZYXCafy9RJXcLuTwT69eE5alNEP+EJoI6fMy3IZ09Ee9fi7jo3HJcWKkG4U8XaFq8nhfTj4NtoaJgHb13LzKYN9yZIXfw1SDc70/o/HZzECS2eUiH4dw/jgM3qgli8X7iyxJEAj4Spsb5Xc/klzlOwQ2GxOYon0RBxpoWjsw5WqxFgb1WxgsbvFnlRVLJo9VGVj/WzhSgRXsz9hhpyztMRpNqZvS0hqLIZtV/5lT39WQFzLnr/7LT7VKSzrHLfjlx57qzZOauxtMYeA1Je9XuunwTur5P3G/JSpcLOQFIHTgEl2Sc7r6HYp8fBmf/fmIelNIUInA8APCoIo9IHjqS4J3Gkmkh95iinVMlAPuwkNHfCY/aM4Z+XsZvJ/q4XIeYW/HKk6INjxigFM76BHGr/YtQhISQKjRWHaZeEn8ZvrdTje7ovYATSK/NuLtSyrAjncTMlZb0j5Ths1lTPSX7RBHYn0BG8BFoFWAfqL9cjM5LvhNnkjULudI/CffqipFkUbbEk4yTJMZSqRFro=----ATTACHMENT:----MTcyMzg2MTg3OTY0OTIyNiAxOTgxMTE2OTAyMTA4MTE2IDU3NTQ2MTAzNTU2NTA3NjA=