Passed
Pull Request — master (#24)
by frey
09:24
created

RequestInternal   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 26
ccs 0
cts 17
cp 0
rs 10
wmc 3

2 Methods

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