Completed
Push — develop ( a5d0c7...2b55ee )
by Vadim
02:36
created

Google::setLanguage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
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
12
{
13
14
    protected $language;
15
    protected $encoding;
16
17
    /**
18
     * Set language option
19
     * @param $language
20
     * @return $this
21
     */
22 4
    public function setLanguage($language)
23
    {
24 4
        $this->language = $language;
25 4
        return $this;
26
    }
27
28
    /**
29
     * Get language option
30
     * @return mixed
31
     */
32 5
    public function getLanguage()
33
    {
34 5
        if (null === $this->language) {
35 1
            throw new RuntimeException('Need add the language option for google adapter');
36
        }
37 4
        return $this->language;
38
    }
39
40
    /**
41
     * Has encoding option
42
     * @return bool
43
     */
44 1
    public function hasLanguage()
45
    {
46 1
        return null !== $this->language;
47
    }
48
49
    /**
50
     * Set encoding [optional]
51
     * @param $encoding
52
     * @return $this
53
     */
54 2
    public function setEncoding($encoding)
55
    {
56 2
        $this->encoding = $encoding;
57 2
        return $this;
58
    }
59
60
    /**
61
     * Get encoding
62
     * @return mixed
63
     */
64 2
    public function getEncoding()
65
    {
66 2
        return $this->encoding;
67
    }
68
69
    /**
70
     * Has encoding option
71
     * @return bool
72
     */
73 4
    public function hasEncoding()
74
    {
75 4
        return null !== $this->encoding;
76
    }
77
}
78