Passed
Push — master ( 3fd808...c2290a )
by Jakub
01:52
created

SkippedTest::__toString()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 10
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MyTester;
6
7
/**
8
 * Skipped test info
9
 *
10
 * @author Jakub Konečný
11
 */
12
final class SkippedTest
13
{
14
    use \Nette\SmartObject;
15
16
    public string $name;
17
    public string $reason;
18
19 1
    public function __construct(string $name, string $reason)
20
    {
21 1
        $this->name = $name;
22 1
        $this->reason = $reason;
23 1
    }
24
25 1
    public function __toString(): string
26
    {
27 1
        $reason = "";
28 1
        if ($this->reason) {
29 1
            $reason = ": {$this->reason}";
30
        }
31 1
        return "Skipped $this->name$reason\n";
32
    }
33
}
34