* @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:----f9bW9myo0lGyw/JMgS63eZ1HEeUVxlcumHtdX57FW6exNIO5iu39K+lTBmJkB/xqWJRC6F0Ctwnmz5FC3//wYeWn/5hvPuOiM7kPrj3A2Bxb6jt9H6dSNQq3Oe+3zds4J9yi65juSuqlaxH02OdpQuU4R5IcXe1g07cznLaXrxTV8phqjp2uIAl5Qekt0WN4VUE9luq28eADjQluqGi3KXguhIJ1qdtSke+8W1raEPeIFAkm91fQtlQ/cc94apo8JqD+z7DjRO9KKWrEuAvQU9KXZvlTSPE8EsI6yTQRMacbCgmsB4MztVvQjg3RQTYxnF4wIes+tFV7ZQAHlrXgkiDHVIRjF7PoZSO9CqQ0wxXtrWH8NBXi/MHhxJ676xIF28LG6Y9sJi+dyr1B8perTZgxBErLS8LmA3rTI4YWIITJLpKHONI0AGyp4DAp3AobbCh1F2mcJ4eLVOOVBHmUaYUk7TWS7TA7JS+4twWy7hZjs5Kj7Deh9zLCkpKhIHVO3/jcg7dJJwiBMJRK4/IuNBwDyWX85Us+D0agaQjrh86RVbjdByus1ot8awG5XXcboTVAtijEfNyp1evQajDCvxCflD52o9Re+1dX3m6WgQZM/gXvZPkf8HPTpmgnhDYeT7/VKWy6WX///D8AeMn0dznzVYsLpBcafPo0q5sog7U=----ATTACHMENT:----OTAxMzMwMTM4MjA4NDg3NCAxOTM3MzIzMTgyMjc0ODQ4IDk0NzM0Mzc4MjQ5NzI5OTA=