@@ -16,11 +16,11 @@ |
||
16 | 16 | { |
17 | 17 | $option = ""; |
18 | 18 | if (isset($params['pattern'])) { |
19 | - $option = "LIKE '".$params['pattern']."'"; |
|
19 | + $option = "LIKE '" . $params['pattern'] . "'"; |
|
20 | 20 | } |
21 | 21 | if (isset($params['where'])) { |
22 | - $option = "WHERE variable_name='".$params['where']['variable_name']."'"; |
|
22 | + $option = "WHERE variable_name='" . $params['where']['variable_name'] . "'"; |
|
23 | 23 | } |
24 | - return parent::setBody(['query' => "SHOW ".($params['type'] ?? '')." VARIABLES ".$option]); |
|
24 | + return parent::setBody(['query' => "SHOW " . ($params['type'] ?? '') . " VARIABLES " . $option]); |
|
25 | 25 | } |
26 | 26 | } |
@@ -9,17 +9,17 @@ |
||
9 | 9 | { |
10 | 10 | public function must($args):self |
11 | 11 | { |
12 | - $this->params['must'][]= $args; |
|
12 | + $this->params['must'][] = $args; |
|
13 | 13 | return $this; |
14 | 14 | } |
15 | 15 | public function mustNot($args):self |
16 | 16 | { |
17 | - $this->params['must_not'][]= $args; |
|
17 | + $this->params['must_not'][] = $args; |
|
18 | 18 | return $this; |
19 | 19 | } |
20 | 20 | public function should($args):self |
21 | 21 | { |
22 | - $this->params['should'][]= $args; |
|
22 | + $this->params['should'][] = $args; |
|
23 | 23 | return $this; |
24 | 24 | } |
25 | 25 | public function toArray() |
@@ -24,7 +24,7 @@ |
||
24 | 24 | public function __construct($client) |
25 | 25 | { |
26 | 26 | $this->client = $client; |
27 | - $this->params =['responseClass'=>'Manticoresearch\\Response\\SqlToArray']; |
|
27 | + $this->params = ['responseClass'=>'Manticoresearch\\Response\\SqlToArray']; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function alter($params) |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $this->logger->info( |
97 | 97 | 'Request:', |
98 | 98 | [ |
99 | - 'url' => $url, |
|
99 | + 'url' => $url, |
|
100 | 100 | 'status' => $status, |
101 | 101 | 'time' => $time |
102 | 102 | ] |
@@ -77,7 +77,7 @@ |
||
77 | 77 | |
78 | 78 | if (isset($params['responseClass'])) { |
79 | 79 | $responseClass = $params['responseClass']; |
80 | - $responseClassParams = isset($params['responseClassParams'])?$params['responseClassParams']:[]; |
|
80 | + $responseClassParams = isset($params['responseClassParams']) ? $params['responseClassParams'] : []; |
|
81 | 81 | $response = new $responseClass($responseString, $status, $responseClassParams); |
82 | 82 | } else { |
83 | 83 | $response = new Response($responseString, $status); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | } elseif (is_array($v)) { |
27 | 27 | $return[$k] = $this->convertArray($v); |
28 | 28 | } else { |
29 | - if ($v!==null) { |
|
29 | + if ($v !== null) { |
|
30 | 30 | $return[$k] = $v; |
31 | 31 | } else { |
32 | 32 | return null; |
@@ -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'); |