Completed
Pull Request — feature/behat (#14)
by Yo
02:46
created

JsonRpcInvalidRequestException::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Yoanm\JsonRpcServer\Domain\Exception;
3
4
/**
5
 * Class JsonRpcInvalidRequestException
6
 */
7
class JsonRpcInvalidRequestException extends JsonRpcException
8
{
9
    const CODE = -32600;
10
11
    /** @var mixed */
12
    private $content;
13
    /** @var string */
14
    private $description;
15
16
    /**
17
     * @param mixed  $content
18
     * @param string $description Optional description of the issue
19
     */
20 3
    public function __construct($content, string $description = '')
21
    {
22 3
        $this->content = $content;
23 3
        $this->description = $description;
24
25 3
        parent::__construct(self::CODE, 'Invalid request');
26 3
    }
27
28
    /**
29
     * @return mixed
30
     */
31 1
    public function getContent()
32
    {
33 1
        return $this->content;
34
    }
35
36
    /**
37
     * @return string
38
     */
39 1
    public function getDescription()
40
    {
41 1
        return $this->description;
42
    }
43
}
44