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

AbstractRequest::setText()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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