for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace AlecRabbit\Cli\Tools;
use const AlecRabbit\ESC;
class Line
{
/**
* Erase from the current cursor position (inclusive) to the end of the line
*
* @return string
*/
public static function eraseFromCursor(): string
return ESC . '[0K';
}
* Erase from the beginning of the line up to the current cursor position (inclusive)
public static function eraseToCursor(): string
return ESC . '[1K';
public static function erase(): string
return ESC . '[2K';
* @param int $num
public static function insert(int $num = 1): string
return ESC . "[{$num}L";
public static function delete(int $num = 1): string
return ESC . "[{$num}M";