Completed
Push — master ( bbfb28...e849e1 )
by Hannes
01:48
created

Definition   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 31
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCodeBlock() 0 4 1
A getAnnotations() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace hanneskod\readmetester\Parser;
6
7
/**
8
 * Value object containing code and annotations defining an example
9
 */
10
class Definition
11
{
12
    /**
13
     * @var Annotation[]
14
     */
15
    private $annotations;
16
17
    /**
18
     * @var CodeBlock
19
     */
20
    private $code;
21
22
    public function __construct(CodeBlock $code, Annotation ...$annotations)
23
    {
24
        $this->code = $code;
25
        $this->annotations = $annotations;
26
    }
27
28
    public function getCodeBlock(): CodeBlock
29
    {
30
        return $this->code;
31
    }
32
33
    /**
34
     * @return Annotation[]
35
     */
36
    public function getAnnotations(): array
37
    {
38
        return $this->annotations;
39
    }
40
}
41