ServerUnavailable::outbound()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 2
dl 0
loc 3
rs 10
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