Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
58.33% |
7 / 12 |
|
87.50% |
7 / 8 |
CRAP | |
0.00% |
0 / 1 |
| ManuscriptDomain | |
58.33% |
7 / 12 |
|
87.50% |
7 / 8 |
12.63 | |
0.00% |
0 / 1 |
| accept | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| __toString | |
0.00% |
0 / 5 |
|
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 | |||
| getName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getParent | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setParent | |
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 | /** |
| 12 | * A hierarchical grouping feature for manuscripts. |
| 13 | * |
| 14 | * @todo Consider if it makes more sense to use tags or such to group manuscripts. |
| 15 | * |
| 16 | * @since 0.1.0 |
| 17 | */ |
| 18 | class ManuscriptDomain implements Persistent { |
| 19 | /** @var string|null 128 bits UUID */ |
| 20 | private $identity; |
| 21 | |
| 22 | /** @var string|null */ |
| 23 | private $name; |
| 24 | |
| 25 | /** |
| 26 | * @var string|null 128 bits UUID |
| 27 | * @see ManuscriptDomain::$identity |
| 28 | */ |
| 29 | private $parent; |
| 30 | |
| 31 | // visitor |
| 32 | |
| 33 | /** |
| 34 | * @param PersistentVisitor $visitor |
| 35 | * @return mixed|null |
| 36 | */ |
| 37 | public function accept( PersistentVisitor $visitor ) { |
| 38 | return $visitor->visitManuscriptDomain( $this ); |
| 39 | } |
| 40 | |
| 41 | public function __toString(): string { |
| 42 | return '[ ' . |
| 43 | 'identity => "' . $this->getIdentity() . '", ' . |
| 44 | 'name => "' . $this->getName() . '", ' . |
| 45 | 'parent => "' . $this->getParent() . '" ' . |
| 46 | ']'; |
| 47 | } |
| 48 | |
| 49 | // getters and setters |
| 50 | |
| 51 | /** |
| 52 | * @see ManuscriptDomain::$identity |
| 53 | * @return string|null |
| 54 | */ |
| 55 | public function getIdentity(): ?string { |
| 56 | return $this->identity; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * @see ManuscriptDomain::$identity |
| 61 | * @param string|null $identity |
| 62 | */ |
| 63 | public function setIdentity( $identity ): void { |
| 64 | $this->identity = $identity; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * @see ManuscriptDomain::$name |
| 69 | * @return string|null |
| 70 | */ |
| 71 | public function getName(): ?string { |
| 72 | return $this->name; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * @see ManuscriptDomain::$name |
| 77 | * @param string|null $name |
| 78 | */ |
| 79 | public function setName( ?string $name ): void { |
| 80 | $this->name = $name; |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * @see ManuscriptDomain::$parent |
| 85 | * @return string|null |
| 86 | */ |
| 87 | public function getParent(): ?string { |
| 88 | return $this->parent; |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * @see ManuscriptDomain::$parent |
| 93 | * @param string|null $parent |
| 94 | */ |
| 95 | public function setParent( ?string $parent ): void { |
| 96 | $this->parent = $parent; |
| 97 | } |
| 98 | } |