RequestGeneric::getId()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
ccs 0
cts 6
cp 0
rs 10
cc 2
nc 2
nop 0
crap 6
1
<?php
2
3
namespace Graze\WipotecCheckweigherClient\Request;
4
5
use Exception;
6
7
class RequestGeneric extends AbstractRequest
8
{
9
    /** @var string */
10
    private $id;
11
12
    /** @var mixed[] */
13
    private $params = [];
14
15
    /**
16
     * @param string $id
17
     */
18
    public function setId($id)
19
    {
20
        $this->id = $id;
21
    }
22
23
    /**
24
     * @return string
25
     */
26
    public function getId()
27
    {
28
        if (!$this->id) {
29
            throw new Exception('Id has not been set');
30
        }
31
32
        return $this->id;
33
    }
34
35
    /**
36
     * @param mixed[] $params
37
     */
38
    public function setParams(array $params)
39
    {
40
        $this->params = $params;
41
    }
42
43
    /**
44
     * @return mixed[]
45
     */
46
    public function getParams()
47
    {
48
        return $this->params;
49
    }
50
}
51