Completed
Push — master ( 59d48e...ffd6fa )
by Sergii
04:52
created

RPCRouter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A addRoute() 0 3 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 *
5
 * @author Donii Sergii <[email protected]>
6
 * Date: 10/24/17
7
 * Time: 10:25 AM
8
 */
9
10
namespace sonrac\WAMP\Routers;
11
12
use sonrac\WAMP\Contracts\RPCRouterInterface;
13
14
/**
15
 * Class RPCRouterInterface
16
 * WAMP RPC router.
17
 */
18
class RPCRouter implements RPCRouterInterface
19
{
20
    use RouterTrait;
21
22
    /**
23
     * Add new procedure.
24
     *
25
     * @param string          $path
26
     * @param string|\Closure $callback
27
     *
28
     * @return \React\Promise\Promise
29
     *
30
     * @author Donii Sergii <[email protected]>
31
     */
32 1
    public function addRoute($path, $callback)
33
    {
34 1
        return $this->getClientSession()->register($path, $this->parseCallback($callback));
35
    }
36
}
37