Completed
Pull Request — master (#1)
by Luc
06:59 queued 03:12
created

Answer   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 54
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isCorrect() 0 3 1
A getText() 0 3 1
A __construct() 0 8 1
A getId() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace VSV\GVQ_API\Question\Models;
4
5
use Ramsey\Uuid\UuidInterface;
6
use VSV\GVQ_API\Question\ValueObjects\NotEmptyString;
7
8
class Answer
9
{
10
    /**
11
     * @var UuidInterface
12
     */
13
    private $id;
14
15
    /**
16
     * @var NotEmptyString
17
     */
18
    private $text;
19
20
    /**
21
     * @var bool
22
     */
23
    private $correct;
24
25
    /**
26
     * @param UuidInterface $id
27
     * @param NotEmptyString $text
28
     * @param bool $correct
29
     */
30
    public function __construct(
31
        UuidInterface $id,
32
        NotEmptyString $text,
33
        bool $correct
34
    ) {
35
        $this->id = $id;
36
        $this->text = $text;
37
        $this->correct = $correct;
38
    }
39
40
    /**
41
     * @return UuidInterface
42
     */
43
    public function getId(): UuidInterface
44
    {
45
        return $this->id;
46
    }
47
48
    /**
49
     * @return NotEmptyString
50
     */
51
    public function getText(): NotEmptyString
52
    {
53
        return $this->text;
54
    }
55
56
    /**
57
     * @return bool
58
     */
59
    public function isCorrect(): bool
60
    {
61
        return $this->correct;
62
    }
63
}
64