| Total Complexity | 3 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class Router extends PeerRouter implements WAMPRouterInterface |
||
| 19 | { |
||
| 20 | use RouterTrait; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * RPC router |
||
| 24 | * |
||
| 25 | * @var \sonrac\WAMP\Contracts\RPCRouterInterface |
||
| 26 | */ |
||
| 27 | protected $rpcRouter; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Publisher/subscription router |
||
| 31 | * |
||
| 32 | * @var \sonrac\WAMP\Contracts\PubSubRouterInterface |
||
| 33 | */ |
||
| 34 | protected $pubSubRouter; |
||
| 35 | |||
| 36 | protected $loop; |
||
| 37 | /** |
||
| 38 | * Routes |
||
| 39 | * |
||
| 40 | * @var array |
||
| 41 | */ |
||
| 42 | protected $routes = []; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Router constructor. |
||
| 46 | * |
||
| 47 | * @param \sonrac\WAMP\Contracts\RPCRouterInterface $RPCRouter |
||
| 48 | * @param \sonrac\WAMP\Contracts\PubSubRouterInterface $pubSubRouter |
||
| 49 | * @param \React\EventLoop\LoopInterface|null $loop |
||
| 50 | */ |
||
| 51 | public function __construct( |
||
| 52 | \sonrac\WAMP\Contracts\RPCRouterInterface $RPCRouter, |
||
| 53 | \sonrac\WAMP\Contracts\PubSubRouterInterface $pubSubRouter, |
||
| 54 | \React\EventLoop\LoopInterface $loop = null |
||
| 55 | ) { |
||
| 56 | $this->rpcRouter = $RPCRouter; |
||
| 57 | $this->pubSubRouter = $pubSubRouter; |
||
| 58 | |||
| 59 | parent::__construct($loop); |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @inheritDoc |
||
| 64 | */ |
||
| 65 | public function dispatch() |
||
| 67 | |||
| 68 | } |
||
| 69 | |||
| 70 | /** |
||
| 71 | * @param string $path Route path |
||
| 72 | * @param \Closure|string $callback Handler |
||
| 73 | */ |
||
| 74 | public function addRoute($path, $callback) |
||
| 77 | } |
||
| 78 | |||
| 80 |