Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
25 / 25
100.00% covered (success)
100.00%
19 / 19
CRAP
100.00% covered (success)
100.00%
1 / 1
Utterance
100.00% covered (success)
100.00%
25 / 25
100.00% covered (success)
100.00%
19 / 19
19
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
 getUtteranceId
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setUtteranceId
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getAudio
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setAudio
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getSynthesisMetadata
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setSynthesisMetadata
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getRemoteWikiHash
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setRemoteWikiHash
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getPageId
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setPageId
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getLanguage
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setLanguage
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getVoice
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setVoice
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getSegmentHash
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setSegmentHash
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getDateStored
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setDateStored
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace MediaWiki\Wikispeech\Utterance;
4
5/**
6 * @file
7 * @ingroup Extensions
8 * @license GPL-2.0-or-later
9 */
10
11use MWTimestamp;
12
13/**
14 * @since 0.1.10
15 */
16class Utterance {
17
18    /** @var int */
19    private $utteranceId;
20
21    /** @var string|null Hash from parts of URL to the wiki containing page segment of this utterance. */
22    private $remoteWikiHash;
23
24    /** @var int Mediawiki page ID. */
25    private $pageId;
26
27    /** @var string ISO 639 */
28    private $language;
29
30    /** @var string Name of synthesis voice. */
31    private $voice;
32
33    /** @var string Hash of segment representing utterance. */
34    private $segmentHash;
35
36    /** @var MWTimestamp */
37    private $dateStored;
38
39    /** @var string Base64 encoded audio file */
40    private $audio;
41
42    /** @var string JSON containing tokens etc describing the audio. */
43    private $synthesisMetadata;
44
45    /**
46     * @since 0.1.10
47     * @param int $utteranceId
48     * @param string|null $remoteWikiHash
49     * @param int $pageId
50     * @param string $language
51     * @param string $voice
52     * @param string $segmentHash
53     * @param MWTimestamp $dateStored
54     */
55    public function __construct(
56        int $utteranceId,
57        ?string $remoteWikiHash,
58        int $pageId,
59        string $language,
60        string $voice,
61        string $segmentHash,
62        MWTimestamp $dateStored
63    ) {
64        $this->utteranceId = $utteranceId;
65        $this->remoteWikiHash = $remoteWikiHash;
66        $this->pageId = $pageId;
67        $this->language = $language;
68        $this->voice = $voice;
69        $this->segmentHash = $segmentHash;
70        $this->dateStored = $dateStored;
71    }
72
73    /**
74     * @since 0.1.10
75     * @return int
76     */
77    public function getUtteranceId(): int {
78        return $this->utteranceId;
79    }
80
81    /**
82     * @since 0.1.10
83     * @param int $utteranceId
84     */
85    public function setUtteranceId( int $utteranceId ): void {
86        $this->utteranceId = $utteranceId;
87    }
88
89    /**
90     * @since 0.1.10
91     * @return string|null
92     */
93    public function getAudio(): ?string {
94        return $this->audio;
95    }
96
97    /**
98     * @since 0.1.10
99     * @param string $audio
100     */
101    public function setAudio( string $audio ): void {
102        $this->audio = $audio;
103    }
104
105    /**
106     * @since 0.1.10
107     * @return string|null
108     */
109    public function getSynthesisMetadata(): ?string {
110        return $this->synthesisMetadata;
111    }
112
113    /**
114     * @since 0.1.10
115     * @param string $synthesisMetadata
116     */
117    public function setSynthesisMetadata( string $synthesisMetadata ): void {
118        $this->synthesisMetadata = $synthesisMetadata;
119    }
120
121    /**
122     * @since 0.1.10
123     * @return string|null
124     */
125    public function getRemoteWikiHash(): ?string {
126        return $this->remoteWikiHash;
127    }
128
129    /**
130     * @since 0.1.10
131     * @param string|null $remoteWikiHash
132     */
133    public function setRemoteWikiHash( ?string $remoteWikiHash ): void {
134        $this->remoteWikiHash = $remoteWikiHash;
135    }
136
137    /**
138     * @since 0.1.10
139     * @return int
140     */
141    public function getPageId(): int {
142        return $this->pageId;
143    }
144
145    /**
146     * @since 0.1.10
147     * @param int $pageId
148     */
149    public function setPageId( int $pageId ): void {
150        $this->pageId = $pageId;
151    }
152
153    /**
154     * @since 0.1.10
155     * @return string
156     */
157    public function getLanguage(): string {
158        return $this->language;
159    }
160
161    /**
162     * @since 0.1.10
163     * @param string $language
164     */
165    public function setLanguage( string $language ): void {
166        $this->language = $language;
167    }
168
169    /**
170     * @since 0.1.10
171     * @return string
172     */
173    public function getVoice(): string {
174        return $this->voice;
175    }
176
177    /**
178     * @since 0.1.10
179     * @param string $voice
180     */
181    public function setVoice( string $voice ): void {
182        $this->voice = $voice;
183    }
184
185    /**
186     * @since 0.1.10
187     * @return string
188     */
189    public function getSegmentHash(): string {
190        return $this->segmentHash;
191    }
192
193    /**
194     * @since 0.1.10
195     * @param string $segmentHash
196     */
197    public function setSegmentHash( string $segmentHash ): void {
198        $this->segmentHash = $segmentHash;
199    }
200
201    /**
202     * @since 0.1.10
203     * @return MWTimestamp
204     */
205    public function getDateStored(): MWTimestamp {
206        return $this->dateStored;
207    }
208
209    /**
210     * @since 0.1.10
211     * @param MWTimestamp $dateStored
212     */
213    public function setDateStored( MWTimestamp $dateStored ): void {
214        $this->dateStored = $dateStored;
215    }
216
217}