JsonRpcMethodNotFoundException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
namespace Yoanm\JsonRpcServer\Domain\Exception;
3
4
/**
5
 * Class JsonRpcMethodNotFoundException
6
 */
7
class JsonRpcMethodNotFoundException extends JsonRpcException
8
{
9
    const CODE = -32601;
10
11
    /** @var string */
12
    private $methodName;
13
14
    /**
15
     * @param string $methodName
16
     */
17 8
    public function __construct(string $methodName)
18
    {
19 8
        $this->methodName = $methodName;
20
21 8
        parent::__construct(self::CODE, 'Method not found');
22
    }
23
24
    /**
25
     * @return string
26
     */
27 1
    public function getMethodName() : string
28
    {
29 1
        return $this->methodName;
30
    }
31
}
32