JsonRpcException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 25
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
getJsonRpcCode() 0 1 ?
A getJsonRpcData() 0 7 1
1
<?php
2
3
namespace PhpJsonRpc\Error;
4
5
abstract class JsonRpcException extends \Exception
6
{
7
    const PARSE_ERROR      = -32700;
8
    const INVALID_REQUEST  = -32600;
9
    const METHOD_NOT_FOUND = -32601;
10
    const INVALID_PARAMS   = -32602;
11
    const INTERNAL_ERROR   = -32603;
12
    const SERVER_ERROR     = -32000;
13
14
    /**
15
     * @return int
16
     */
17
    abstract public function getJsonRpcCode(): int;
18
19
    /**
20
     * @return array
21
     */
22
    final public function getJsonRpcData()
23
    {
24
        return [
25
            'code'    => $this->getCode(),
26
            'message' => $this->getMessage()
27
        ];
28
    }
29
}
30