Completed
Push — feature/app ( 1db7b9...7c1fce )
by Yo
01:35
created

JsonRpcInvalidParamsException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php
2
namespace Yoanm\JsonRpcServer\Domain\Exception;
3
4
/**
5
 * Class JsonRpcInvalidParamsException
6
 */
7
class JsonRpcInvalidParamsException extends JsonRpcException
8
{
9
    const CODE = -32602;
10
11
    const DATA_METHOD_KEY = 'method';
12
    const DATA_MESSAGE_KEY = 'message';
13
14
    /**
15
     * @param string $method
16
     * @param string $message
17
     */
18 2
    public function __construct(string $method, string $message)
19
    {
20 2
        parent::__construct(
21 2
            self::CODE,
22 2
            'Invalid params',
23
            [
24 2
                self::DATA_METHOD_KEY => $method,
25 2
                self::DATA_MESSAGE_KEY => $message,
26
            ]
27
        );
28 2
    }
29
}
30