-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathViewService.php
More file actions
38 lines (30 loc) · 826 Bytes
/
ViewService.php
File metadata and controls
38 lines (30 loc) · 826 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
<?php
declare(strict_types=1);
namespace DragonCode\Benchmark\Services;
use DragonCode\Benchmark\View\LineView;
use DragonCode\Benchmark\View\ProgressBarView;
use DragonCode\Benchmark\View\TableView;
class ViewService
{
public function __construct(
protected TableView $table = new TableView,
protected ProgressBarView $progressBar = new ProgressBarView,
protected LineView $line = new LineView,
) {}
public function table(array $data): void
{
$this->table->show($data);
}
public function progressBar(): ProgressBarView
{
return $this->progressBar;
}
public function line(string $text): void
{
$this->line->line($text);
}
public function emptyLine(int $count = 1): void
{
$this->line->newLine($count);
}
}