* @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:----VAM48Mm7pB3gbyBt1x7FoAdoZL/Oh6CPQ9TFuowAzDCvVuw33bBDHZke4/ejl6TJdId1p37VnM8TjHi+ZoQFBs3btMfysd1m1aOy7IQRNjh53wa2AntIXqkZGC5RnBiR33kqiPl0aUyYWZjc28y1NtEeJwwCYqs7YA5YT/z0ZaVaXR67Z40XxNryQEsisTMQ/x+rBLcVR+I5jR2w9nBKI7e3rMkGpnDOHEoGSyOm/Zb8sY0c40+ZMXL6H4BaqrmRC9MHd3Aoa6NIp4Zsh/e5zcnHkDOKz0USqz7rQGi7C7uVPU1BDpGDNu78Hx2SFyrH9wJ0Xe8yteOcgguP8tuB2Z12Ho4Hz+nIQSXcZuzLO1yxPFxT1ebbxXavTKs5zjhgyyzS2BgA6Jj8qLncDY91aoSna3MN+A4emJ0mODrh5lbvQrKeXa0HCjsCoE8n8VXShe39MGMTd+5LsYbVaprZ3Kxy2HCA5k5f3b4P8wglj5anOTIVwCSvu43HwLWuSGa5iBR24A/qify3IdpMdtDCcKgfjbxYyAnHd1k4NAq5j87+3wZ2cMBpS4eoVkBb54fTj5fowwBSuOFG4A4Hu2lOQXLvA6wh1gQ8lh3X8PpZ0SRCSRzoABpDQ9j+rTePDTJqhnDchfS4KEBCJFWSv6JMaszYgU8yVqacQnSgL4x4Fdg=----ATTACHMENT:----MTE4NzM2NTA4NDA4MDYwNiA5NjM5MTg3NDQ2NTU4MzIwIDYyMzMzOTQ1ODkyMTk5ODI=