Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
61.11% |
11 / 18 |
|
91.67% |
11 / 12 |
CRAP | |
0.00% |
0 / 1 |
| RecordingReview | |
61.11% |
11 / 18 |
|
91.67% |
11 / 12 |
20.47 | |
0.00% |
0 / 1 |
| accept | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| __toString | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
2 | |||
| getIdentity | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setIdentity | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getCreated | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setCreated | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getValue | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setValue | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getReviewer | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setReviewer | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getRecording | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setRecording | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\WikispeechSpeechDataCollector\Domain; |
| 4 | |
| 5 | /** |
| 6 | * @file |
| 7 | * @ingroup Extensions |
| 8 | * @license GPL-2.0-or-later |
| 9 | */ |
| 10 | |
| 11 | use MWTimestamp; |
| 12 | |
| 13 | /** |
| 14 | * Whether or not a {@link Recording} is good according to a specific {@link User}. |
| 15 | * |
| 16 | * @since 0.1.0 |
| 17 | */ |
| 18 | class RecordingReview implements Persistent { |
| 19 | /** @var string|null 128 bits UUID */ |
| 20 | private $identity; |
| 21 | |
| 22 | /** @var MWTimestamp|null */ |
| 23 | private $created; |
| 24 | |
| 25 | /** |
| 26 | * @var int|null |
| 27 | * @see RecordingReviewValue |
| 28 | */ |
| 29 | private $value; |
| 30 | |
| 31 | /** |
| 32 | * @var string|null 128 bits UUID |
| 33 | * @see User::$identity |
| 34 | */ |
| 35 | private $reviewer; |
| 36 | |
| 37 | /** |
| 38 | * @var string|null 128 bits UUID |
| 39 | * @see Recording::$identity |
| 40 | */ |
| 41 | private $recording; |
| 42 | |
| 43 | // visitor |
| 44 | |
| 45 | /** |
| 46 | * @param PersistentVisitor $visitor |
| 47 | * @return mixed|null |
| 48 | */ |
| 49 | public function accept( PersistentVisitor $visitor ) { |
| 50 | return $visitor->visitRecordingReview( $this ); |
| 51 | } |
| 52 | |
| 53 | public function __toString(): string { |
| 54 | return '[ ' . |
| 55 | 'identity => "' . $this->getIdentity() . '", ' . |
| 56 | 'created => "' . $this->getCreated() . '", ' . |
| 57 | 'value => "' . $this->getValue() . '", ' . |
| 58 | 'reviewer => "' . $this->getReviewer() . '", ' . |
| 59 | 'recording => "' . $this->getRecording() . '" ' . |
| 60 | ']'; |
| 61 | } |
| 62 | |
| 63 | // getters and setters |
| 64 | |
| 65 | /** |
| 66 | * @see RecordingReview::$identity |
| 67 | * @return string|null |
| 68 | */ |
| 69 | public function getIdentity(): ?string { |
| 70 | return $this->identity; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * @see RecordingReview::$identity |
| 75 | * @param string|null $identity |
| 76 | */ |
| 77 | public function setIdentity( $identity ): void { |
| 78 | $this->identity = $identity; |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * @see RecordingReview::$created |
| 83 | * @return MWTimestamp|null |
| 84 | */ |
| 85 | public function getCreated(): ?MWTimestamp { |
| 86 | return $this->created; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * @see RecordingReview::$created |
| 91 | * @param MWTimestamp|null $created |
| 92 | */ |
| 93 | public function setCreated( ?MWTimestamp $created ): void { |
| 94 | $this->created = $created; |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * @see RecordingReview::$value |
| 99 | * @return int|null |
| 100 | */ |
| 101 | public function getValue(): ?int { |
| 102 | return $this->value; |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * @see RecordingReview::$value |
| 107 | * @param int|null $value |
| 108 | */ |
| 109 | public function setValue( ?int $value ): void { |
| 110 | $this->value = $value; |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * @see RecordingReview::$reviewer |
| 115 | * @return string|null |
| 116 | */ |
| 117 | public function getReviewer(): ?string { |
| 118 | return $this->reviewer; |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * @see RecordingReview::$reviewer |
| 123 | * @param string|null $reviewer |
| 124 | */ |
| 125 | public function setReviewer( ?string $reviewer ): void { |
| 126 | $this->reviewer = $reviewer; |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * @see RecordingReview::$recording |
| 131 | * @return string|null |
| 132 | */ |
| 133 | public function getRecording(): ?string { |
| 134 | return $this->recording; |
| 135 | } |
| 136 | |
| 137 | /** |
| 138 | * @see RecordingReview::$recording |
| 139 | * @param string|null $recording |
| 140 | */ |
| 141 | public function setRecording( ?string $recording ): void { |
| 142 | $this->recording = $recording; |
| 143 | } |
| 144 | } |