Code Duplication    Length = 9-10 lines in 2 locations

src/TextToSpeech.php 1 location

@@ 37-45 (lines=9) @@
34
        $this->driver = new $adapterClass('ru_RU', '0.5');
35
    }
36
37
    public function setText($text)
38
    {
39
        $text = trim(str_replace(["\r", "\n", '"', "'", '«', '»'], ' ', $text));
40
        $text = preg_replace('/([ ]{2,})/', ' ', $text);
41
        $text = mb_strtolower($text);
42
43
        $this->text = $text;
44
        return $this;
45
    }
46
47
    public function clear()
48
    {

src/TextToSpeechAbstract.php 1 location

@@ 74-83 (lines=10) @@
71
     * @param string $text
72
     * @return $this
73
     */
74
    public function addText($text)
75
    {
76
        $text = trim(str_replace(["\r", "\n", '"', "'", '«', '»'], ' ', $text));
77
        $text = preg_replace('/([ ]{2,})/', ' ', $text);
78
        $text = mb_strtolower($text);
79
80
        $this->lines[] = $text;
81
82
        return $this;
83
    }
84
85
    /**
86
     * @return $this