CMQServerNetworkException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 25
ccs 0
cts 15
cp 0
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 7 1
A __construct() 0 8 2
1
<?php
2
3
namespace Freyo\LaravelQueueCMQ\Queue\Driver;
4
5
class CMQServerNetworkException extends CMQExceptionBase
6
{
7
    //服务器网络异常
8
9
    public $status;
10
    public $header;
11
    public $data;
12
13
    public function __construct($status = 200, $header = null, $data = '')
14
    {
15
        if ($header == null) {
16
            $header = [];
17
        }
18
        $this->status = $status;
19
        $this->header = $header;
20
        $this->data = $data;
21
    }
22
23
    public function __toString()
24
    {
25
        $info = ['status'      => $this->status,
26
                      'header' => json_encode($this->header),
27
                      'data'   => $this->data, ];
28
29
        return 'CMQServerNetworkException  '.json_encode($info);
30
    }
31
}
32