AbstractMethod   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 32
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
run() 0 1 ?
A rpcMethodName() 0 4 1
1
<?php
2
3
namespace PhpJsonRpc\Server\Service\Method;
4
5
use PhpJsonRpc\Server\Request\Params;
6
use PhpJsonRpc\Server\Service\Method\Contract;
7
use PhpJsonRpc\Server\Service\Method\Exception\NotCallable;
8
9
abstract class AbstractMethod implements Contract\Method
10
{
11
    /**
12
     * @var string
13
     */
14
    protected $rpcMethodName;
15
16
    /**
17
     * @param string $rpcMethodName
18
     */
19 69
    public function __construct($rpcMethodName)
20
    {
21 69
        $this->rpcMethodName = $rpcMethodName;
22 69
    }
23
24
    /**
25
     * @param Params|null $params
26
     *
27
     * @return mixed
28
     *
29
     * @throws NotCallable
30
     */
31
    abstract public function run(Params $params = null);
32
33
    /**
34
     * @return string
35
     */
36 27
    public function rpcMethodName()
37
    {
38 27
        return $this->rpcMethodName;
39
    }
40
}
41