Settings::setBody()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
cc 2
eloc 3
c 2
b 1
f 1
nc 2
nop 1
dl 0
loc 6
rs 10
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