Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 5
CRAP
0.00% covered (danger)
0.00%
0 / 1
CleanedText
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 5
30
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getString
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setString
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getPath
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setPath
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\Wikispeech\Segment;
4
5/**
6 * @file
7 * @ingroup Extensions
8 * @license GPL-2.0-or-later
9 */
10
11/**
12 * Holds information about a text node that has been cleaned, to be
13 * used during recitation.
14 *
15 * @since 0.0.1
16 */
17
18class CleanedText implements SegmentContent {
19    /**
20     * The text content from the text node this was created from.
21     *
22     * @var string
23     */
24    private $string;
25
26    /**
27     * The XPath expression for the text node that this was created
28     * from.
29     *
30     * @var string
31     */
32    private $path;
33
34    /**
35     * Create a CleanedText, given a string representation.
36     *
37     * If the path isn't set, it defaults to the empty string.
38     *
39     * @since 0.0.1
40     * @param string $string The string representation of this text.
41     * @param string $path The path to the text node this was created from.
42     */
43    public function __construct(
44        string $string,
45        string $path = ''
46    ) {
47        $this->string = $string;
48        $this->path = $path;
49    }
50
51    /**
52     * @since 0.1.10
53     * @return string
54     */
55    public function getString(): string {
56        return $this->string;
57    }
58
59    /**
60     * @since 0.1.10
61     * @param string $string
62     */
63    public function setString( string $string ): void {
64        $this->string = $string;
65    }
66
67    /**
68     * @since 0.1.10
69     * @return string
70     */
71    public function getPath(): string {
72        return $this->path;
73    }
74
75    /**
76     * @since 0.1.10
77     * @param string $path
78     */
79    public function setPath( string $path ): void {
80        $this->path = $path;
81    }
82
83}