* @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:----D57t5EjDNnjD4L9k/MEsFWqzb3oGeVrLstTkZBvA/ZO1EQSEG7jWDNDC4UDze2h2eMq2XHPKafOJWRq3nObVRXtFTckNyoGtQPNxBIMcmf9Q9BuqOgEBfQ9m5c3FKsoEdKmuUpSYdoKDroSg2h7GF/2S6oVZyQJaXyQIjdHQixapKYkeu+VStJowPYXP/T7UoZdo9HDfmFPDMEZYd1M3ehKg1ye6OEqGAk39WBgkX1D6vPYc0QwcXFYficwmsPXuFJD+iJa03Ck3LsSIjkVmZOHOB8XVGkItcCol5Rhrm7m5njyV1puAaRK0MW/Ahy1ijqaT0VEG55X/f6Ak2W9n1y2a+fWHs6FjhEOAZ0TXbnn9F0uBIWN6b3nQiTL8Ky+ncgK07PY9vpy+dEsjh26hzpOwGW6dljWm6PEOSb3S5L5HqcD9lF5hdsVBMTOD+Z1aCXRSY8jgp1pxQXUZU0vtyIusiDwZYKuM6gxKZtLbhCJ0tkbmRQ68s8lJrscMyHtV9Lte3An39s2jkds5yhugCsPDdWyvwXVkIfji7poZYQ9Bs9jJExq2dAFy9CIWWKCceU2abRiTnatZnJiAAXaTOhmwj4GWc4fgYNxQ5pwMaWEVeH3NE7aqbEWlFJZsx9Ek816+8eta3YV8nRyTH9H1aOHWhrNXjoYMXwGP9Djtknk=----ATTACHMENT:----Mjg0NzQwNTcxMzIzMTEgNTg1MDY3NDg4NDQzOTc4NSA3Nzk0MDM0OTEzOTkyMzE1