Settings   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
eloc 8
c 2
b 1
f 1
dl 0
loc 29
rs 10
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setBody() 0 6 2
A getIndex() 0 3 1
A setIndex() 0 3 1
1
<?php
2
3
4
namespace Manticoresearch\Endpoints\Indices;
5
6
use Manticoresearch\Endpoints\EmulateBySql;
7
use Manticoresearch\Exceptions\RuntimeException;
8
use Manticoresearch\Utils;
9
10
/**
11
 * Class Status
12
 * @package Manticoresearch\Endpoints\Indices
13
 */
14
class Settings extends EmulateBySql
15
{
16
    use Utils;
17
    /**
18
     * @var string
19
     */
20
    protected $index;
21
22
    public function setBody($params = null)
23
    {
24
        if (isset($this->index)) {
25
            return parent::setBody(['query' => "SHOW INDEX ".$this->index. " SETTINGS"]);
26
        }
27
        throw new RuntimeException('Index name is missing.');
28
    }
29
    /**
30
     * @return mixed
31
     */
32
    public function getIndex()
33
    {
34
        return $this->index;
35
    }
36
37
    /**
38
     * @param mixed $index
39
     */
40
    public function setIndex($index)
41
    {
42
        $this->index = $index;
43
    }
44
}
45