Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
Answer
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 4
20
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 getQuestionDBID
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getOption
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getText
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare( strict_types=1 );
4
5namespace MediaWiki\Extension\CampaignEvents\Questions;
6
7/**
8 * Value object represting an answer to a participant question.
9 */
10class Answer {
11    private int $questionDBID;
12    private ?int $option;
13    private ?string $text;
14
15    /**
16     * @param int $questionDBID
17     * @param int|null $option
18     * @param string|null $text
19     */
20    public function __construct( int $questionDBID, ?int $option, ?string $text ) {
21        $this->questionDBID = $questionDBID;
22        $this->option = $option;
23        $this->text = $text;
24    }
25
26    /**
27     * @return int
28     */
29    public function getQuestionDBID(): int {
30        return $this->questionDBID;
31    }
32
33    /**
34     * @return int|null
35     */
36    public function getOption(): ?int {
37        return $this->option;
38    }
39
40    /**
41     * @return string|null
42     */
43    public function getText(): ?string {
44        return $this->text;
45    }
46}