* @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:----A6YpKrrKiuDDfRMnpLA37LQOPuix80MA4a4cjvSNC+Uz/iuMAxVmmru1e8YNOxefmZ/0x0rK9w1ad1wQIaOxRJHd0VZNGipUkLvMfblCTPUjBrGgfGmUZfP2RVTV95XgIL3TkHjXPWyE967GD7PVxbs4Pk8alf+/03TNOyIIhaCZv5qT2K9fFrEWEYpAWlt06Xc+aRmf4y1bMhG+9QE08OdHLBMXC8Tabd1KDGSD11pIk7MBEGqvpyUt1/FLbggx/+n5/GBUKPmYiETyVVlnVYkhWOC2A9JfHDYDuwtdyw+Y2o0LCJLyV6QuksyEyMW6oo8g2LSv0ALBz+eAEpyhQsGRe0E5m4xqKes0XJqY7YdgCwysaaFEplLoBsp716YJ8UejChOF6pmoDNiloNpQGAToSntgvM9+CUPiGT/DmBYoqdg6FYaOqCVAKosEo6SLO1mYqQ4qpE6rzESwzne5aff4lpY5QWfx/PFj9cTvfpFs0zUFj3Y6qlYKZHEoPAkOAhEeSJ+G9tg9W3+4qIuOTEepoMKTIk2UjiB2s2b47Q7QxoEJX8KXKCR+yYi2OswtNLau39TGbCd7UqmQKLzhQd59wpcbtCcftdd+zWT5FfUoqYo1OFZnByqTpJImwsi+hj4HTmpKN33bnrL0e/M+wKHSaOkGX0T4zqqaCpO44xc=----ATTACHMENT:----MTAzMjI3NDU0OTQ3MzI1NiAzMTUyMDgwMTY4NDI2NzY0IDkwMzgyMjIxMzAxMjUzNTU=