first commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace League\CLImate\TerminalObject\Basic;
|
||||
|
||||
final class ClearLine extends Repeatable
|
||||
{
|
||||
/**
|
||||
* Clear the lines.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function result()
|
||||
{
|
||||
$string = "";
|
||||
while ($this->count > 0) {
|
||||
$string .= $this->util->cursor->startOfCurrentLine();
|
||||
$string .= $this->util->cursor->deleteCurrentLine();
|
||||
--$this->count;
|
||||
|
||||
$string .= $this->util->cursor->up();
|
||||
}
|
||||
|
||||
$string .= $this->util->cursor->down();
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function sameLine()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user