Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 14 |
|
0.00% |
0 / 9 |
CRAP | |
0.00% |
0 / 1 |
| RecordingAnnotation | |
0.00% |
0 / 14 |
|
0.00% |
0 / 9 |
90 | |
0.00% |
0 / 1 |
| __toString | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| getStart | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setStart | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getEnd | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setEnd | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getStereotype | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setStereotype | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getValue | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setValue | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 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 | /** |
| 12 | * Metadata describing a part between a start and an endpoint |
| 13 | * of the audio in a {@link Recording}. |
| 14 | * |
| 15 | * @since 0.1.0 |
| 16 | */ |
| 17 | class RecordingAnnotation { |
| 18 | |
| 19 | /** @var int|null Start position in milliseconds of recorded audio. */ |
| 20 | private $start; |
| 21 | |
| 22 | /** @var int|null End posision in milliseconds of recorded audio. */ |
| 23 | private $end; |
| 24 | |
| 25 | /** |
| 26 | * @var string|null What sort of values this is, e.g. "White noise level" |
| 27 | */ |
| 28 | private $stereotype; |
| 29 | |
| 30 | /** |
| 31 | * @var mixed The value associated with the stereotype. E.g. "-9dBm". |
| 32 | */ |
| 33 | private $value; |
| 34 | |
| 35 | public function __toString(): string { |
| 36 | return '[ ' . |
| 37 | 'start => "' . $this->getStart() . '", ' . |
| 38 | 'end => "' . $this->getEnd() . '", ' . |
| 39 | 'stereotype => "' . $this->getStereotype() . '", ' . |
| 40 | 'value => "' . $this->getValue() . '" ' . |
| 41 | ']'; |
| 42 | } |
| 43 | |
| 44 | // getters and setters |
| 45 | |
| 46 | /** |
| 47 | * @see RecordingAnnotation::$start |
| 48 | * @return int|null |
| 49 | */ |
| 50 | public function getStart(): ?int { |
| 51 | return $this->start; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * @see RecordingAnnotation::$start |
| 56 | * @param int|null $start |
| 57 | */ |
| 58 | public function setStart( ?int $start ): void { |
| 59 | $this->start = $start; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * @see RecordingAnnotation::$end |
| 64 | * @return int|null |
| 65 | */ |
| 66 | public function getEnd(): ?int { |
| 67 | return $this->end; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * @see RecordingAnnotation::$end |
| 72 | * @param int|null $end |
| 73 | */ |
| 74 | public function setEnd( ?int $end ): void { |
| 75 | $this->end = $end; |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * @see RecordingAnnotation::$stereotype |
| 80 | * @return string|null |
| 81 | */ |
| 82 | public function getStereotype(): ?string { |
| 83 | return $this->stereotype; |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * @see RecordingAnnotation::$stereotype |
| 88 | * @param string|null $stereotype |
| 89 | */ |
| 90 | public function setStereotype( ?string $stereotype ): void { |
| 91 | $this->stereotype = $stereotype; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * @see RecordingAnnotation::$value |
| 96 | * @return mixed |
| 97 | */ |
| 98 | public function getValue() { |
| 99 | return $this->value; |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * @see RecordingAnnotation::$value |
| 104 | * @param mixed $value |
| 105 | */ |
| 106 | public function setValue( $value ): void { |
| 107 | $this->value = $value; |
| 108 | } |
| 109 | } |