Passed
Pull Request — master (#129)
by Serhii
15:48 queued 07:26
created

Search   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 26
ccs 7
cts 7
cp 1
rs 10
c 2
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A toArray() 0 5 1
1
<?php
2
3
namespace Matchish\ScoutElasticSearch\ElasticSearch\Params;
4
5
/**
6
 * @internal
7
 */
8
final class Search
9
{
10
    /**
11
     * @var string
12
     */
13
    private $index;
14
    /**
15
     * @var array
16
     */
17
    private $body;
18
19
    /**
20
     * @param string $index
21
     * @param array $body
22
     */
23 7
    public function __construct(string $index, array $body)
24
    {
25 7
        $this->index = $index;
26 7
        $this->body = $body;
27 7
    }
28
29 7
    public function toArray(): array
30
    {
31
        return [
32 7
            'index' => $this->index,
33 7
            'body' => $this->body,
34
        ];
35
    }
36
}
37