* @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:----IRLgk7izOVbaiorBVoF9i7bxVSMtVhmQyWsDxbtjAwuSV3vELJ5C7PGEl4R1JbHUpZMOzbHcbvIZhePq9wp0RQl0aMkHD8YrlTwnIKURE7ZtsFWD5C9EWkzpmQ4FZiHNFih+14U3WMp+aUmVNwX/A1lGzyRq9muQiioBK1SXdJQKN1Z8kniixYZqSbou9QgbzHzYYIhV7Vs1W1KZj+mMCPlsq2jb8u30VgY3QEIh2hyPJI+Jc0dXtu4fVTM+feRDffLEWZW1h6uKoT8/aU1WVhva0hn9o+bMz890/toDuThZ7H2oKVoNci7v8IrMBt1PrQEr7IO1XNuMfzQP5II6Nv3/WNGqUawoIreRs9xI6yGkxr2WOO1zUp2WcUrc/Thvzw0MVVy2pLWIH5JqzBuCr4csfDgAcgQRy4KizBdEwwmAz64kO/Id5G/qp9SQ0mG3Ba+7T6GPYviuvH3dMq8w6E+vbRY3jZH+nCAF0Zr8mCxhuNglo43wqENWieOJVye9S6a4LQR9n2e308gq+lfP88UpveKjsa3vlZWidBCfci+FKoZlFl+ahSG4AbE27Ai/jIDmCtVBhj/blc9Opy/pFf60qILBg/csSx9XD1HRhgHbcTSiYV4E4RIx0Yoqhx1LaHj772Px67Mjllml9SDyAjCoxrdoPUwg4nZK6p+toJ4=----ATTACHMENT:----NjczOTkxNjI0MDk3MzkwOSA2MjUyMDcyMjU1MjA0MDk1IDk5OTY5NDkyOTUwOTgzODg=