-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathLineView.php
More file actions
34 lines (28 loc) · 661 Bytes
/
LineView.php
File metadata and controls
34 lines (28 loc) · 661 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
<?php
declare(strict_types=1);
namespace DragonCode\Benchmark\View;
use function array_fill;
use function implode;
use function max;
class LineView extends View
{
/**
* Outputs a line of text.
*
* @param string $text The text to output.
*/
public function line(string $text): void
{
$this->writeLine($text);
}
/**
* Outputs the specified number of empty lines.
*
* @param int $count The number of empty lines.
*/
public function newLine(int $count = 1): void
{
$lines = implode('', array_fill(0, max(1, $count), PHP_EOL));
$this->writeLine($lines);
}
}