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

JsonRpcInvalidRequestException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 35
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getContent() 0 3 1
A getDescription() 0 3 1
A __construct() 0 6 1
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