JsonRpcController   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 4
dl 0
loc 32
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A method_1() 0 4 1
A method_2() 0 4 1
A method_3() 0 4 1
A method_4() 0 4 1
A method_5() 0 4 1
A method_6() 0 4 1
1
<?php
2
3
namespace PhpJsonRpc\Server\Stub;
4
5
use PhpJsonRpc\Server\Request\Params;
6
use PhpJsonRpc\Server\Stub\ValueObject\Age;
7
use PhpJsonRpc\Server\Stub\ValueObject\Name;
8
use PhpJsonRpc\Server\Stub\ValueObject\CustomParams;
9
10
class JsonRpcController
11
{
12
    public function method_1()
13
    {
14
        return 'result of method_1';
15
    }
16
17
    public function method_2($name, $age)
18
    {
19
        return "result of method_2: {$name}, {$age}";
20
    }
21
22
    public function method_3(Name $name, Age $age)
23
    {
24
        return "result of method_3: {$name->toNative()}, {$age->toNative()}";
25
    }
26
27
    public function method_4(Params $params)
28
    {
29
        return "result of method_4: {$params->get('name')}, {$params->get('age')}";
30
    }
31
32
    public function method_5(CustomParams $params)
33
    {
34
        return "result of method_5: {$params->name()}, {$params->age()}";
35
    }
36
37
    public function method_6()
38
    {
39
        throw new \RuntimeException('Something is wrong!');
40
    }
41
}
42