first commit

This commit is contained in:
2018-08-01 16:00:05 +02:00
commit 944fd76206
3205 changed files with 356767 additions and 0 deletions
+70
View File
@@ -0,0 +1,70 @@
<?php
namespace League\CLImate\Util;
class Cursor
{
/**
* Move the cursor up in the terminal x number of lines.
*
* @param int $lines
*
* @return string
*/
public function up($lines = 1)
{
return "\e[{$lines}A";
}
/**
* Move the cursor left in the terminal x number of columns.
*
* @param int $cols
*
* @return string
*/
public function left($cols = 1)
{
return "\e[{$cols}D";
}
/**
* Move cursor to the beginning of the current line.
*
* @return string
*/
public function startOfCurrentLine()
{
return "\r";
}
/**
* Delete the current line to the end.
*
* @return string
*/
public function deleteCurrentLine()
{
return "\e[K";
}
/**
* Get the style for hiding the cursor
*
* @return string
*/
public function hide()
{
return "\e[?25l";
}
/**
* Get the style for returning the cursor to its default
*
* @return string
*/
public function defaultStyle()
{
return "\e[?25h";
}
}