Completed
Push — master ( be5d10...3892c2 )
by Sergey
07:31
created

Response   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 43.48%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 47
ccs 10
cts 23
cp 0.4348
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getIndex() 0 4 1
A getType() 0 4 1
A getId() 0 4 1
A getSource() 0 4 1
1
<?php
2
3
namespace Isswp101\Persimmon\Elasticsearch;
4
5
use Illuminate\Support\Arr;
6
7
class Response
8
{
9
    public $index;
10
    public $type;
11
    public $id;
12
    public $source = [];
13
14 15
    public function __construct(array $res)
15
    {
16 15
        $this->index = Arr::get($res, '_index');
17 15
        $this->type = Arr::get($res, '_type');
18 15
        $this->id = Arr::get($res, '_id');
19 15
        $this->source = Arr::get($res, '_source', []);
20 15
    }
21
22
    /**
23
     * @return mixed
24
     */
25
    public function getIndex()
26
    {
27
        return $this->index;
28
    }
29
30
    /**
31
     * @return mixed
32
     */
33
    public function getType()
34
    {
35
        return $this->type;
36
    }
37
38
    /**
39
     * @return mixed
40
     */
41 15
    public function getId()
42
    {
43 15
        return $this->id;
44
    }
45
46
    /**
47
     * @return array
48
     */
49 15
    public function getSource()
50
    {
51 15
        return $this->source;
52
    }
53
}
54