Failed Conditions
Pull Request — master (#1)
by Yo
01:44
created

JsonRpcEndpoint::index()   A

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
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Yoanm\SymfonyJsonRpcHttpServer\Infra\Endpoint;
3
4
use Symfony\Component\HttpFoundation\Request;
5
use Symfony\Component\HttpFoundation\Response;
6
use Yoanm\JsonRpcServer\Infra\Endpoint\JsonRpcEndpoint as SDKJsonRpcEndpoint;
7
8
class JsonRpcEndpoint
9
{
10
    /** @var SdkJsonRpcEndpoint */
11
    private $sdkEndpoint;
12
13
    public function __construct(SDKJsonRpcEndpoint $sdkEndpoint)
14
    {
15
        $this->sdkEndpoint = $sdkEndpoint;
16
    }
17
18
    public function index(Request $request) : Response
19
    {
20
        return new Response(
21
            $this->sdkEndpoint->index($request->getContent())
22
        );
23
    }
24
}
25