ResponseInternal   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

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