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

Definition::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
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