Passed
Pull Request — master (#33)
by Melech
03:22
created

Output::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Valkyrja Framework package.
7
 *
8
 * (c) Melech Mizrachi <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Valkyrja\Test\Output\Outputters;
15
16
use Valkyrja\Test\Output\Formatter;
17
use Valkyrja\Test\Output\Formatters\Formatter as DefaultFormatter;
18
use Valkyrja\Test\Output\Output as Contract;
19
use Valkyrja\Test\Output\Results;
20
21
/**
22
 * Class Output.
23
 *
24
 * @author Melech Mizrachi
25
 */
26
abstract class Output implements Contract
27
{
28
    public function __construct(
29
        protected Formatter $formatter = new DefaultFormatter(),
30
    ) {
31
    }
32
33
    /**
34
     * @inheritDoc
35
     */
36
    public function full(Results $results): void
37
    {
38
        $this->title();
39
        $this->sectionSpacing();
40
        $this->tests($results);
41
        $this->sectionSpacing();
42
        $this->completed($results);
43
        $this->sectionSpacing();
44
        $this->meta();
45
        $this->sectionSpacing();
46
        $this->results($results);
47
        $this->issues($results);
48
    }
49
50
    /**
51
     * @inheritDoc
52
     */
53
    abstract public function title(): void;
54
55
    /**
56
     * @inheritDoc
57
     */
58
    abstract public function meta(): void;
59
60
    /**
61
     * @inheritDoc
62
     */
63
    abstract public function tests(Results $results): void;
64
65
    /**
66
     * @inheritDoc
67
     */
68
    abstract public function completed(Results $results): void;
69
70
    /**
71
     * @inheritDoc
72
     */
73
    abstract public function results(Results $results): void;
74
75
    /**
76
     * @inheritDoc
77
     */
78
    abstract public function issues(Results $results): void;
79
80
    /**
81
     * @inheritDoc
82
     */
83
    abstract public function sectionSpacing(): void;
84
}
85