ReloadPlugins::setBody()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 2
eloc 4
c 2
b 0
f 1
nc 2
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
4
namespace Manticoresearch\Endpoints\Nodes;
5
6
use Manticoresearch\Endpoints\EmulateBySql;
7
use Manticoresearch\Exceptions\RuntimeException;
8
use Manticoresearch\Utils;
9
10
class ReloadPlugins extends EmulateBySql
11
{
12
    use Utils;
13
    /**
14
     * @var string
15
     */
16
    protected $index;
17
18
    public function setBody($params = null)
19
    {
20
        $this->body = $params;
21
        if (isset($params['library'])) {
22
            return parent::setBody(['query' => "RELOAD PLUGINS FROM SONAME ".$params['library']]);
23
        }
24
        throw new RuntimeException('library name not present in  /nodes/reloadplugins');
25
    }
26
}
27