Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
61.90% covered (warning)
61.90%
13 / 21
92.86% covered (success)
92.86%
13 / 14
CRAP
0.00% covered (danger)
0.00%
0 / 1
Manuscript
61.90% covered (warning)
61.90%
13 / 21
92.86% covered (success)
92.86%
13 / 14
24.84
0.00% covered (danger)
0.00%
0 / 1
 accept
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 __toString
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
2
 getIdentity
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setIdentity
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getName
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setName
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getCreated
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setCreated
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getDisabled
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setDisabled
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
 getDomain
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setDomain
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace MediaWiki\WikispeechSpeechDataCollector\Domain;
4
5/**
6 * @file
7 * @ingroup Extensions
8 * @license GPL-2.0-or-later
9 */
10
11use MWTimestamp;
12
13/**
14 * A manuscript is a complete text which is required to be completely recorded
15 * in order to produce a voice synthesizer. Manuscripts are broken down in
16 * smaller parts, {@link ManuscriptPrompt}, ordered segments with a lexical flow,
17 * large enough for a single recording.
18 *
19 * @since 0.1.0
20 */
21class Manuscript implements Persistent {
22    /** @var string|null 128 bits UUID */
23    private $identity;
24
25    /** @var string|null */
26    private $name;
27
28    /** @var MWTimestamp|null */
29    private $created;
30
31    /** @var MWTimestamp|null */
32    private $disabled;
33
34    /**
35     * @var string|null 128 bits UUID
36     * @see Language::$identity
37     */
38    private $language;
39
40    /**
41     * @var string|null 128 bits UUID
42     * @see ManuscriptDomain::$identity
43     */
44    private $domain;
45
46    // visitor
47
48    /**
49     * @param PersistentVisitor $visitor
50     * @return mixed|null
51     */
52    public function accept( PersistentVisitor $visitor ) {
53        return $visitor->visitManuscript( $this );
54    }
55
56    public function __toString(): string {
57        return '[ ' .
58            'identity => "' . $this->getIdentity() . '", ' .
59            'name => "' . $this->getName() . '", ' .
60            'created => "' . $this->getCreated() . '", ' .
61            'disabled => "' . $this->getDisabled() . '", ' .
62            'language => "' . $this->getLanguage() . '", ' .
63            'domain => "' . $this->getDomain() . '" ' .
64            ']';
65    }
66
67    // getters and setters
68
69    /**
70     * @see Manuscript::$identity
71     * @return string|null
72     */
73    public function getIdentity(): ?string {
74        return $this->identity;
75    }
76
77    /**
78     * @see Manuscript::$identity
79     * @param string|null $identity
80     */
81    public function setIdentity( $identity ): void {
82        $this->identity = $identity;
83    }
84
85    /**
86     * @see Manuscript::$name
87     * @return string|null
88     */
89    public function getName(): ?string {
90        return $this->name;
91    }
92
93    /**
94     * @see Manuscript::$name
95     * @param string|null $name
96     */
97    public function setName( ?string $name ): void {
98        $this->name = $name;
99    }
100
101    /**
102     * @see Manuscript::$created
103     * @return MWTimestamp|null
104     */
105    public function getCreated(): ?MWTimestamp {
106        return $this->created;
107    }
108
109    /**
110     * @see Manuscript::$created
111     * @param MWTimestamp|null $created
112     */
113    public function setCreated( ?MWTimestamp $created ): void {
114        $this->created = $created;
115    }
116
117    /**
118     * @see Manuscript::$disabled
119     * @return MWTimestamp|null
120     */
121    public function getDisabled(): ?MWTimestamp {
122        return $this->disabled;
123    }
124
125    /**
126     * @see Manuscript::$disabled
127     * @param MWTimestamp|null $disabled
128     */
129    public function setDisabled( ?MWTimestamp $disabled ): void {
130        $this->disabled = $disabled;
131    }
132
133    /**
134     * @see Manuscript::$language
135     * @return string|null
136     */
137    public function getLanguage(): ?string {
138        return $this->language;
139    }
140
141    /**
142     * @see Manuscript::$language
143     * @param string|null $language
144     */
145    public function setLanguage( ?string $language ): void {
146        $this->language = $language;
147    }
148
149    /**
150     * @see Manuscript::$domain
151     * @return string|null
152     */
153    public function getDomain(): ?string {
154        return $this->domain;
155    }
156
157    /**
158     * @see Manuscript::$domain
159     * @param string|null $domain
160     */
161    public function setDomain( ?string $domain ): void {
162        $this->domain = $domain;
163    }
164}