Completed
Push — master ( f743de...f8a04a )
by Daniel
03:18
created

JsonRpcGenericErrorException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 17
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __toString() 0 9 1
1
<?php
2
3
namespace Cmobi\RabbitmqBundle\Rpc\Exception;
4
5
abstract class JsonRpcGenericErrorException extends \Exception
6
{
7
    public function __construct($message = "", $code = 0, \Exception $previous = null)
8
    {
9
        parent::__construct($message, $code, $previous);
10
    }
11
12
    public function __toString()
13
    {
14
        $error = [
15
            'code' => (int)$this->code,
16
            'message' => (string)$this->message
17
        ];
18
19
        return json_encode($error);
20
    }
21
}