Search   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 41
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getIndex() 0 3 1
A setIndex() 0 3 1
A getMethod() 0 3 1
A getPath() 0 6 2
1
<?php
2
3
4
namespace Manticoresearch\Endpoints\Pq;
5
6
use Manticoresearch\Exceptions\RuntimeException;
7
use Manticoresearch\Request;
8
9
/**
10
 * Class Search
11
 * @package Manticoresearch\Endpoints\Pq
12
 */
13
class Search extends Request
14
{
15
16
    /**
17
     * @var string
18
     */
19
    protected $index;
20
21
    /**
22
     * @return mixed|string
23
     */
24
    public function getMethod()
25
    {
26
        return 'POST';
27
    }
28
29
    /**
30
     * @return mixed|string
31
     */
32
    public function getPath()
33
    {
34
        if (isset($this->index)) {
35
            return "/json/pq/" . $this->index . "/_search";
36
        }
37
        throw new RuntimeException('Index name is missing.');
38
    }
39
40
    /**
41
     * @return mixed
42
     */
43
    public function getIndex()
44
    {
45
        return $this->index;
46
    }
47
48
    /**
49
     * @param mixed $index
50
     */
51
    public function setIndex($index)
52
    {
53
        $this->index = $index;
54
    }
55
}
56