Completed
Push — master ( dea263...7d2382 )
by Craig
01:29
created

ClearLine::result()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace League\CLImate\TerminalObject\Basic;
4
5
final class ClearLine extends Repeatable
6
{
7
    /**
8
     * Clear the lines.
9
     *
10
     * @return string
11
     */
12
    public function result()
13
    {
14
        $string = "";
15
        while ($this->count > 0) {
16
            $string .= $this->util->cursor->startOfCurrentLine();
17
            $string .= $this->util->cursor->deleteCurrentLine();
18
            --$this->count;
19
20
            $string .= $this->util->cursor->up();
21
        }
22
23
        $string .= $this->util->cursor->down();
24
25
        return $string;
26
    }
27
28
29
    /**
30
     * @inheritdoc
31
     */
32
    public function sameLine()
33
    {
34
        return true;
35
    }
36
}
37