TextCaptcha::getAnswer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Didatus\TextCaptcha;
4
5
use Ramsey\Uuid\Uuid;
6
7
/**
8
 * Class TextCaptcha
9
 * @package Didatus\TextCaptcha
10
 */
11
class TextCaptcha {
12
13
    /**
14
     * @var string
15
     */
16
    private $question;
17
18
    /**
19
     * @var string
20
     */
21
    private $answer;
22
23
    /**
24
     * @var string
25
     */
26
    private $uuid;
27
28
    /**
29
     * TextCaptcha constructor.
30
     *
31
     * @param string $question
32
     * @param string $answer
33
     */
34 8
    public function __construct(string $question, string $answer)
35
    {
36 8
        $this->question = $question;
37 8
        $this->answer = $answer;
38 8
        $this->uuid = Uuid::uuid1()->toString();
39 8
    }
40
41
    /**
42
     * @return string
43
     */
44 6
    public function getQuestion(): string
45
    {
46 6
        return $this->question;
47
    }
48
49
    /**
50
     * @return string
51
     */
52 6
    public function getAnswer(): string
53
    {
54 6
        return $this->answer;
55
    }
56
57
    /**
58
     * @return string
59
     */
60 1
    public function getUuid(): string
61
    {
62 1
        return $this->uuid;
63
    }
64
65
    /**
66
     * @param string $uuid
67
     */
68
    public function setUuid(string $uuid): void
69
    {
70
        $this->uuid = $uuid;
71
    }
72
73
74
}
75