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

Google   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 1 Features 0
Metric Value
wmc 7
c 3
b 1
f 0
lcom 2
cbo 2
dl 0
loc 67
ccs 16
cts 16
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setLanguage() 0 5 1
A getLanguage() 0 7 2
A hasLanguage() 0 4 1
A setEncoding() 0 5 1
A getEncoding() 0 4 1
A hasEncoding() 0 4 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