* @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:----J1GiOR14kQe10FsvaJoxgB3s7g58wtyCQZJHi/fjXYbpRzqgJPBOW/UXUF8gjH1Y7dnbxNBTwH4i7hdTql8Aa556rcTWTF1IUxlfiSyJmxbl7jmNFkmunS9EPRvOu5mSPgDsGrQVrNPetHzmIgjq68wc9R0Lh9GsRGwp7Ll8zlSSvP6E62SE5JhSCPKuWkFvkNtqhW509gzhnyBXCXyWZSyhwi9b7iUxeWcuBQv7+1WY6jbvA8l/8eX4JXwfcvAB+2aCeEw6r9KeOPMhbnnG+wD18jFXF8mRJLV8RD6tQpcRrafLEKPVX9zA1Navk5vdDVYsO/Vfrqie2szQCHIaetH1nPFiCr4Wnk6P2dGn/ype9YA9dAbYzpjpQyXwaFkjFQuEZ/062glfqvVX+Qtlxr9hc4o+O2+pxj7Zm+Tvj02+e8dOPro8227njzswbVLmiYjlDiKVqPClGA4p2s8ZCc7Gk1fWSELFmtol8ZlDzAO/HTxwbLo0ZfMCO5K9wxlLGFnG/P6iBUIH4PSLXA9Yj2dmcKplXRBq5+qGwRjL8gaCoh+BIi0wq9xPDJ00klIOeLgAgSIH/vVf7wADN6TyPTXwgUKjhy3XO44ERyUhfxReJ2LX7EQkMKAXDKMroKdoAEPsMVsw1LTAgGZelklHLCCaASWYVv4pzq7DBHeSYCk=----ATTACHMENT:----MTAyNTY5ODk4NDQyMzU2NyA1NzMzOTY3NzUyODg0MTQ1IDc2Mzk0NjMyNDI5NzE4Mjk=