Completed
Push — develop ( 86f0dd...f71342 )
by Adam
12s
created

Service   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 44
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getVersion() 0 4 1
A setVersion() 0 4 1
A tone() 0 4 1
1
<?php
2
/**
3
 * Tone Analyzer Service class
4
 */
5
namespace IBM\Watson\ToneAnalyzer;
6
7
use IBM\Watson\Common\AbstractService;
8
use IBM\Watson\ToneAnalyzer\Message\ToneRequest;
9
10
/**
11
 * Tone Analyzer Service class
12
 *
13
 * This class provides and interface for interacting with the
14
 * IBM Watson Tone Analyzer service
15
 *
16
 * @link https://www.ibm.com/watson/developercloud/tone-analyzer.html
17
 * @see AbstractService
18
 */
19
class Service extends AbstractService
20
{
21
    /**
22
     * Get service name
23
     *
24
     * @return string
25
     */
26 3
    public function getName()
27
    {
28 3
        return 'Tone Analyzer';
29
    }
30
31
    /**
32
     * Get API version
33
     *
34
     * @return string
35
     */
36 3
    public function getVersion()
37
    {
38 3
        return $this->getParameter('version');
39
    }
40
41
    /**
42
     * Set API version
43
     *
44
     * @param string $value
45
     * @return $this
46
     */
47 3
    public function setVersion($value)
48
    {
49 3
        return $this->setParameter('version', $value);
50
    }
51
52
    /**
53
     * Analyze tone
54
     *
55
     * @param array $parameters
56
     * @return \IBM\Watson\Common\Message\AbstractRequest
57
     */
58 2
    public function tone(array $parameters = [])
59
    {
60 2
        return $this->createRequest(ToneRequest::class, $parameters);
61
    }
62
}
63