@@ -13,7 +13,7 @@ |
||
13 | 13 | public function setBody($params = null) |
14 | 14 | { |
15 | 15 | if (isset($this->index)) { |
16 | - $binds =[]; |
|
16 | + $binds = []; |
|
17 | 17 | $binds[] = "'" . self::escape($params['query']) . "'"; |
18 | 18 | $binds[] = "'" . $this->index . "'"; |
19 | 19 | if (count($params['options']) > 0) { |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | if (isset($this->index)) { |
20 | 20 | if (isset($params['query'])) { |
21 | - return parent::setBody(['query' => "EXPLAIN QUERY ".$this->index. '\''.$params['query'].'\'']); |
|
21 | + return parent::setBody(['query' => "EXPLAIN QUERY " . $this->index . '\'' . $params['query'] . '\'']); |
|
22 | 22 | } |
23 | 23 | throw new RuntimeException('Query param is missing.'); |
24 | 24 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | if ($this->mode === 'raw') { |
37 | 37 | $return = ['mode=raw']; |
38 | 38 | foreach ($this->body as $k => $v) { |
39 | - $return[]= $k.'='.$v; |
|
39 | + $return[] = $k . '=' . $v; |
|
40 | 40 | } |
41 | 41 | return implode('&', $return); |
42 | 42 | } else { |
@@ -35,7 +35,7 @@ |
||
35 | 35 | throw new RuntimeException('Index name is missing.'); |
36 | 36 | break; |
37 | 37 | case 'update': |
38 | - return parent::setBody(['query' => "ALTER CLUSTER " .$this->cluster . " UPDATE nodes"]); |
|
38 | + return parent::setBody(['query' => "ALTER CLUSTER " . $this->cluster . " UPDATE nodes"]); |
|
39 | 39 | break; |
40 | 40 | } |
41 | 41 | throw new RuntimeException('Unknown cluster operation'); |
@@ -24,17 +24,17 @@ |
||
24 | 24 | { |
25 | 25 | if (isset($this->cluster)) { |
26 | 26 | if (isset($params['node'])) { |
27 | - $this->body = ['query' => "JOIN CLUSTER ".$this->cluster." AT ".$params['node']]; |
|
27 | + $this->body = ['query' => "JOIN CLUSTER " . $this->cluster . " AT " . $params['node']]; |
|
28 | 28 | } else { |
29 | - $options =[]; |
|
29 | + $options = []; |
|
30 | 30 | if (isset($params['path'])) { |
31 | - $options[] = "'".$params['path']. "' AS path"; |
|
31 | + $options[] = "'" . $params['path'] . "' AS path"; |
|
32 | 32 | } |
33 | 33 | if (isset($params['nodes'])) { |
34 | - $options[] = "'".$params['nodes']. "' AS nodes"; |
|
34 | + $options[] = "'" . $params['nodes'] . "' AS nodes"; |
|
35 | 35 | } |
36 | - $this->body = ['query' => "JOIN CLUSTER ".$this->cluster. |
|
37 | - ((count($options)>0)?" ".implode(',', $options):"")]; |
|
36 | + $this->body = ['query' => "JOIN CLUSTER " . $this->cluster . |
|
37 | + ((count($options) > 0) ? " " . implode(',', $options) : "")]; |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | throw new RuntimeException('Cluster name is missing.'); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | public function setBody($params = null) |
24 | 24 | { |
25 | 25 | if (isset($this->cluster)) { |
26 | - return parent::setBody(['query' => "DELETE CLUSTER ".$this->cluster]); |
|
26 | + return parent::setBody(['query' => "DELETE CLUSTER " . $this->cluster]); |
|
27 | 27 | } |
28 | 28 | throw new RuntimeException('Cluster name is missing.'); |
29 | 29 | } |
@@ -22,6 +22,6 @@ |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | return parent::setBody(['query' => "SHOW THREADS " . |
25 | - ((count($options)>0)?' OPTION '.implode(",", $options):'')]); |
|
25 | + ((count($options) > 0) ? ' OPTION ' . implode(",", $options) : '')]); |
|
26 | 26 | } |
27 | 27 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | { |
20 | 20 | $this->body = $params; |
21 | 21 | if (isset($params['library'])) { |
22 | - return parent::setBody(['query' => "RELOAD PLUGINS FROM SONAME ".$params['library']]); |
|
22 | + return parent::setBody(['query' => "RELOAD PLUGINS FROM SONAME " . $params['library']]); |
|
23 | 23 | } |
24 | 24 | throw new RuntimeException('library name not present in /nodes/reloadplugins'); |
25 | 25 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | public function setBody($params = null) |
17 | 17 | { |
18 | 18 | if (isset($params['name'])) { |
19 | - return parent::setBody(['query' => "DROP PLUGIN " . $params['name']." TYPE".$params['type']]); |
|
19 | + return parent::setBody(['query' => "DROP PLUGIN " . $params['name'] . " TYPE" . $params['type']]); |
|
20 | 20 | } |
21 | 21 | throw new RuntimeException('Missing plugin name in /nodes/dropplugin'); |
22 | 22 | } |