LegacyCallMiddleware   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 9
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 7 2
1
<?php
2
3
/**
4
 * This file is part of the tarantool/client package.
5
 *
6
 * (c) Eugene Leonovich <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace App;
15
16
use Tarantool\Client\Handler\Handler;
17
use Tarantool\Client\Middleware\Middleware;
18
use Tarantool\Client\Request\CallRequest;
19
use Tarantool\Client\Request\Request;
20
use Tarantool\Client\Response;
21
22
final class LegacyCallMiddleware implements Middleware
23
{
24
    public function process(Request $request, Handler $handler) : Response
25
    {
26
        if (!$request instanceof CallRequest) {
27
            return $handler->handle($request);
28
        }
29
30
        return $handler->handle(LegacyCallRequest::fromCallRequest($request));
31
    }
32
}
33