JsonRpcInvalidRequestException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 35
ccs 8
cts 8
cp 1
rs 10
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 21
    public function __construct($content, string $description = '')
21
    {
22 21
        $this->content = $content;
23 21
        $this->description = $description;
24
25 21
        parent::__construct(self::CODE, 'Invalid request');
26
    }
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() : string
40
    {
41 1
        return $this->description;
42
    }
43
}
44