Completed
Push — master ( c7d7d2...b9efc1 )
by Vadim
02:49
created

Google::setVoice()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace AudioManager\Adapter\Options;
4
5
use AudioManager\Exception\RuntimeException;
6
7
/**
8
 * Hold options for google adapter
9
 * @package AudioManager\Adapter\Google
10
 */
11
class Google extends AbstractOptions implements OptionsInterface
12
{
13
14
    protected $language;
15
    protected $encoding;
16
    protected $voice;
17
18
    /**
19
     * Set language option
20
     * @param $language
21
     * @return $this
22
     */
23 4
    public function setLanguage($language)
24
    {
25 4
        $this->language = $language;
26 4
        return $this;
27
    }
28
29
    /**
30
     * Get language option
31
     * @return mixed
32
     */
33 5
    public function getLanguage()
34
    {
35 5
        if (null === $this->language) {
36 1
            throw new RuntimeException('Need add the language option for google adapter');
37
        }
38 4
        return $this->language;
39
    }
40
41
    /**
42
     * @inheritdoc
43
     */
44
    public function setVoice($voice)
45
    {
46
        $this->voice = $voice;
47
        return $this;
48
    }
49
50
    /**
51
     * @inheritdoc
52
     */
53
    public function getVoice()
54
    {
55
        return $this->voice;
56
    }
57
58
    /**
59
     * Has encoding option
60
     * @return bool
61
     */
62 1
    public function hasLanguage()
63
    {
64 1
        return null !== $this->language;
65
    }
66
67
    /**
68
     * Set encoding [optional]
69
     * @param $encoding
70
     * @return $this
71
     */
72 2
    public function setEncoding($encoding)
73
    {
74 2
        $this->encoding = $encoding;
75 2
        return $this;
76
    }
77
78
    /**
79
     * Get encoding
80
     * @return mixed
81
     */
82 2
    public function getEncoding()
83
    {
84 2
        return $this->encoding;
85
    }
86
87
    /**
88
     * Has encoding option
89
     * @return bool
90
     */
91 4
    public function hasEncoding()
92
    {
93 4
        return null !== $this->encoding;
94
    }
95
}
96