Skip to content

Commit 61d9d24

Browse files
committed
Remove clearEntireLine and replace clearLine
1 parent b044b34 commit 61d9d24

File tree

3 files changed

+1
-30
lines changed

3 files changed

+1
-30
lines changed

src/Terminal.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ public function clear() : void;
8080
* Clear the current cursors line
8181
*/
8282
public function clearLine() : void;
83-
84-
/**
85-
* Erase the entire current line
86-
*/
87-
public function clearEntireLine() : void;
8883

8984
/**
9085
* Erase screen from the current line down to the bottom of the screen

src/UnixTerminal.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,6 @@ public function clear() : void
192192
}
193193

194194
public function clearLine() : void
195-
{
196-
$this->output->write(sprintf("\033[%dD\033[K", $this->getWidth()));
197-
}
198-
199-
/**
200-
* Erase the entire current line
201-
*/
202-
public function clearEntireLine() : void
203195
{
204196
$this->output->write("\033[2K");
205197
}

test/UnixTerminalTest.php

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -145,24 +145,8 @@ public function testClearLine() : void
145145
$output = new BufferedOutput;
146146

147147
$terminal = new UnixTerminal($input, $output);
148-
$rf = new \ReflectionObject($terminal);
149-
$rp = $rf->getProperty('width');
150-
$rp->setAccessible(true);
151-
$rp->setValue($terminal, 23);
152-
153148
$terminal->clearLine();
154149

155-
self::assertEquals("\033[23D\033[K", $output->fetch());
156-
}
157-
158-
public function testClearEntireLine() : void
159-
{
160-
$input = $this->createMock(InputStream::class);
161-
$output = new BufferedOutput;
162-
163-
$terminal = new UnixTerminal($input, $output);
164-
$terminal->clearEntireLine();
165-
166150
self::assertEquals("\033[2K", $output->fetch());
167151
}
168152

@@ -193,7 +177,7 @@ public function testClean() : void
193177

194178
$terminal->clean();
195179

196-
self::assertEquals("\033[0;0H\033[23D\033[K\033[1;0H\033[23D\033[K\033[2;0H\033[23D\033[K", $output->fetch());
180+
self::assertEquals("\033[0;0H\033[2K\033[1;0H\033[2K\033[2;0H\033[2K", $output->fetch());
197181
}
198182

199183
public function testEnableCursor() : void

0 commit comments

Comments
 (0)