ServerUnavailable   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 15
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A inbound() 0 3 1
A outbound() 0 3 1
A exception() 0 3 1
1
<?php
2
/**
3
 * Server unavailable forced
4
 * User: moyo
5
 * Date: 2018/7/18
6
 * Time: 2:51 PM
7
 */
8
9
namespace Carno\HRPC\Handlers;
10
11
use Carno\Chain\Layered;
12
use Carno\Coroutine\Context;
13
use Carno\HRPC\Exception\ServerUnavailableException;
14
use Throwable;
15
16
class ServerUnavailable implements Layered
17
{
18
    public function inbound($message, Context $ctx)
19
    {
20
        throw new ServerUnavailableException();
21
    }
22
23
    public function outbound($message, Context $ctx)
24
    {
25
        return $message;
26
    }
27
28
    public function exception(Throwable $e, Context $ctx)
29
    {
30
        throw $e;
31
    }
32
}
33