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

Example   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 50
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldBeEvaluated() 0 3 1
A getCodeBlock() 0 3 1
A getName() 0 3 1
A getExpectations() 0 3 1
A __construct() 0 5 1
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