* @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:----B3UNFYD7nm6LyU+eFDaA6ee/GlLm43M+SSVqsM24z+Y/ldTGWHUZfd0VK7Mexh7mYlnTnz3ip59TR0zNgDUA9Z6ph1IfzfcyAB21FtsgB7uygxF/8fFGTOOHVQrHdD4Xt86HyRWHDV5WMoivPssfX7RNb2TIJdFm6k8tLvsJSQPwWi/fgsDTHVU7u3bRwo6xoLYwUMhj00sfwH8Gn5HCAV/P2jC2qwKdWVhUH7kPKHbpDptobZGKl327hO+loiSA+DX4ydvGqB1i0nY9JUcB7wdLxIk89eXGc2bvzPupripotdutwFcnuUSlgripP7GptZGUdUqz/K5tH8pcqwgOomJce+RQmHouOIFbwvFr9M73cfQJSy3fTen6Mj1twJe/kLyaozCtuIc+wFV1o7xg8M5Vx9/0Jnb/vmLK8rTqpWmM2/yqCBjhYWkqiy5/tZbaaiDH1T5rYhBIMwQW3Loo1I5ztp501BoBkx9qdBXWnJUhWmGAeQeomesU9EIxEeoJmUgIR9JOyVT3niBRACVuWcIOni/4KRSVdfnB1CEXUi5b1vj0ipKoptdE48LaK+skyq2YNeWSgTNW+L3msN5mawtfNcAWi+iVOf2QItdSrEQWzhZkv7Gs6TmgVGcqSzxNQA8MU8lEWJra0LGhiik/YI3eXUZqCQyJu8vyjuFaDbg=----ATTACHMENT:----OTQ2ODM3MjEzODU4MDMyOSA1ODgxNzQ1MTYxOTk4OTExIDg5MDMyMTAyMTE2OTE0Mw==