Test Failed
Push — master ( 614ce5...540a9b )
by Hannes
02:11
created

Example::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace hanneskod\readmetester\Example;
6
7
use hanneskod\readmetester\Expectation\ExpectationInterface;
8
use hanneskod\readmetester\Parser\CodeBlock;
9
10
/**
11
 * Default example
12
 */
13
class Example
14
{
15
    /**
16
     * @var string
17
     */
18
    private $name;
19
20
    /**
21
     * @var CodeBlock
22
     */
23
    private $code;
24
25
    /**
26
     * @var ExpectationInterface[]
27
     */
28
    private $expectations;
29
30
    /**
31
     * @param string                 $name         Name of this example
32
     * @param CodeBlock              $code         Example code
33
     * @param ExpectationInterface[] $expectations List of expectations
34
     */
35
    public function __construct(string $name, CodeBlock $code, array $expectations)
36
    {
37
        $this->name = $name;
38
        $this->code = $code;
39
        $this->expectations = $expectations;
40
    }
41
42
    public function getName(): string
43
    {
44
        return $this->name;
45
    }
46
47
    public function shouldBeEvaluated(): bool
48
    {
49
        return true;
50
    }
51
52
    public function getCodeBlock(): CodeBlock
53
    {
54
        return $this->code;
55
    }
56
57
    /**
58
     * @return ExpectationInterface[]
59
     */
60
    public function getExpectations(): array
61
    {
62
        return $this->expectations;
63
    }
64
}
65