* @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:----DCXKz3LhiSptnCa8bAV5by2+7RL1FIhpFUkRjKE3acJmfz8gzChszzP3vu6fxxR4sEmGb30OgeU13B59Aqq3qOR/pv5DY2er/XOYOqLOrq+i5LCkjw8Q6sdx5/NB3M9X9+Gxh+gyRqxkTTaMRVXFsIlw27ESooDZ3ttiSJECsGX5rAbAdzkkzMXCx3MntKWYgtJgcOvq0Q28mJ+EKWuSiXsaoKSFADa+N0tu1v6SGuBW4tKnHUYcG8usjLA0rR3zw4EHWsUrdDPIHni3HI6ETmQNXzhln/ftb8YNFRV6IVXxGHQIafqTj40e5okHeLxT48oiv2m+sdzltEtvqg4+ftWl4qbsLhhyIod2dmjVVTo4EwIeZnTSjK6/i+TGep5+EFwbcgu1/0jPpjFAHnZ+WdnK3bjIhWu3d71FsBKiUPjEIQlFqGaOLpKJ0IekVS+hQElTVXcFVTbyQc7ItU11G+p6+i3cv10vYOTvaOHOtI/h+UwxgPbnz8eugLvAnFredyJK08kMd/Wd0SAD5Fr9k1ZuzsC4VO1Z8G+ve1PGJL6jl3yIXm7FFd4613vCH3zt/Onf9/4VYnzOoPB/uY2fGE/CegVwTHGfyXA17IUAF2mJBNSdRWiXMncYVDN0TiXuqCy4jZKQAJAie7GvyiQyyENGJbE7Lym9O767aD0ytRM=----ATTACHMENT:----NzE5NDAyMzMxMDcxMjQ5MiA1MTYyMDIxOTE3NDMxMDcwIDY4MTYxMjA1NjE2OTA3OA==