forked from php-school/cli-menu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrame.php
More file actions
46 lines (39 loc) · 816 Bytes
/
Copy pathFrame.php
File metadata and controls
46 lines (39 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace PhpSchool\CliMenu;
/**
* Represents the current screen being displayed
* contains all rows of output
*
* @author Aydin Hassan <[email protected]>
*/
class Frame implements \Countable
{
/**
* @var array
*/
private $rows = [];
public function newLine(int $count = 1) : void
{
foreach (range(1, $count) as $i) {
$this->rows[] = "\n";
}
}
public function addRows(array $rows = []) : void
{
foreach ($rows as $row) {
$this->rows[] = $row;
}
}
public function addRow(string $row) : void
{
$this->rows[] = $row;
}
public function count() : int
{
return count($this->rows);
}
public function getRows() : array
{
return $this->rows;
}
}