Completed
Pull Request — develop (#2)
by Adam
05:32
created

AbstractRequest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 54
c 0
b 0
f 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getVersion() 0 4 1
A setVersion() 0 4 1
A getText() 0 4 1
A setText() 0 4 1
1
<?php
2
/**
3
 * Abstract Tone Request class
4
 */
5
namespace IBM\Watson\ToneAnalyzer\Message;
6
use IBM\Watson\Common\Message\AbstractRequest as BaseAbstractRequest;
7
8
/**
9
 * Abstract Tone Request class
10
 * @see BaseAbstractRequest
11
 */
12
abstract class AbstractRequest extends BaseAbstractRequest
13
{
14
    /**
15
     * Default API version
16
     */
17
    const DEFAULT_VERSION = '2016-05-19';
18
19
    /**
20
     * @var string
21
     */
22
    protected $endpoint = 'https://gateway.watsonplatform.net/tone-analyzer/api/v3';
23
24
    /**
25
     * Get API version
26
     *
27
     * @return string
28
     */
29
    public function getVersion()
30
    {
31
        return $this->getParameter('version', self::DEFAULT_VERSION);
32
    }
33
34
    /**
35
     * Set API version
36
     *
37
     * @param string $value
38
     * @return $this
39
     */
40
    public function setVersion($value)
41
    {
42
        return $this->setParameter('version', $value);
43
    }
44
45
    /**
46
     * Get request text to analyze
47
     *
48
     * @return string
49
     */
50
    public function getText()
51
    {
52
        return $this->getParameter('text');
53
    }
54
55
    /**
56
     * Set request text to analyze
57
     *
58
     * @param string $value
59
     * @return $this
60
     */
61
    public function setText($value)
62
    {
63
        return $this->setParameter('text', $value);
64
    }
65
}
66