ExceptionDump   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 32
rs 10
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A inbound() 0 3 1
A outbound() 0 3 1
A exception() 0 3 3
1
<?php
2
/**
3
 * Exception handler
4
 * User: moyo
5
 * Date: 11/01/2018
6
 * Time: 5:11 PM
7
 */
8
9
namespace Carno\HRPC\Handlers;
10
11
use Carno\Chain\Layered;
12
use Carno\Coroutine\Context;
13
use Carno\HRPC\Client\Chips\ErrorsClassify;
14
use Throwable;
15
16
class ExceptionDump implements Layered
17
{
18
    use ErrorsClassify;
19
20
    /**
21
     * @param mixed $message
22
     * @param Context $ctx
23
     * @return mixed
24
     */
25
    public function inbound($message, Context $ctx)
26
    {
27
        return $message;
28
    }
29
30
    /**
31
     * @param mixed $message
32
     * @param Context $ctx
33
     * @return mixed
34
     */
35
    public function outbound($message, Context $ctx)
36
    {
37
        return $message;
38
    }
39
40
    /**
41
     * @param Throwable $e
42
     * @param Context $ctx
43
     * @return void
44
     */
45
    public function exception(Throwable $e, Context $ctx)
46
    {
47
        $this->isGenericException($e) || debug() && dump($e);
48
    }
49
}
50