ReloadPlugins   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 7
c 2
b 0
f 1
dl 0
loc 15
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A setBody() 0 7 2
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