Total Complexity | 5 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Coverage | 84.62% |
Changes | 0 |
1 | <?php |
||
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 |
||
71 | } |
||
72 | |||
73 | |||
74 | } |
||
75 |