Request   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 36
ccs 6
cts 8
cp 0.75
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A isNotification() 0 4 1
A id() 0 4 1
1
<?php
2
3
namespace PhpJsonRpc\Server\Request;
4
5
use PhpJsonRpc\Server\Error\ParseError;
6
use PhpJsonRpc\Server\Error\InvalidRequest;
7
8
class Request extends AbstractRequest
9
{
10
    /**
11
     * @var string|int|null
12
     */
13
    protected $id;
14
15
    /**
16
     * @param \stdClass $jsonRpcMessage
17
     *
18
     * @throws InvalidRequest
19
     * @throws ParseError
20
     */
21 15
    public function __construct(\stdClass $jsonRpcMessage)
22
    {
23 15
        parent::__construct($jsonRpcMessage);
24
25 15
        $this->id = $jsonRpcMessage->id;
26 15
    }
27
28
    /**
29
     * @return bool
30
     */
31
    public function isNotification()
32
    {
33
        return false;
34
    }
35
36
    /**
37
     * @return int|string
38
     */
39 15
    public function id()
40
    {
41 15
        return $this->id;
42
    }
43
}
44