Request::isNotification()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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