@@ -10,17 +10,17 @@ |
||
10 | 10 | { |
11 | 11 | public function must($args):self |
12 | 12 | { |
13 | - $this->_params['must'][]= $args; |
|
13 | + $this->_params['must'][] = $args; |
|
14 | 14 | return $this; |
15 | 15 | } |
16 | 16 | public function mustNot($args):self |
17 | 17 | { |
18 | - $this->_params['must_not'][]= $args; |
|
18 | + $this->_params['must_not'][] = $args; |
|
19 | 19 | return $this; |
20 | 20 | } |
21 | 21 | public function should($args):self |
22 | 22 | { |
23 | - $this->_params['should'][]= $args; |
|
23 | + $this->_params['should'][] = $args; |
|
24 | 24 | return $this; |
25 | 25 | } |
26 | 26 | public function toArray() |
@@ -20,7 +20,7 @@ |
||
20 | 20 | { |
21 | 21 | |
22 | 22 | if (isset($this->_index)) { |
23 | - return parent::setBody(['query' => "FLUSH RAMCHUNK ".$this->_index]); |
|
23 | + return parent::setBody(['query' => "FLUSH RAMCHUNK " . $this->_index]); |
|
24 | 24 | } |
25 | 25 | throw new RuntimeException('Index name is missing.'); |
26 | 26 | } |
@@ -104,21 +104,21 @@ |
||
104 | 104 | return $this; |
105 | 105 | } |
106 | 106 | |
107 | - public function highlight($fields = [],$settings=[]): self |
|
107 | + public function highlight($fields = [], $settings = []): self |
|
108 | 108 | { |
109 | 109 | |
110 | - if (count($fields) === 0 && count($settings)===0) { |
|
111 | - $this->_params['highlight'] = new \stdClass(); |
|
110 | + if (count($fields) === 0 && count($settings) === 0) { |
|
111 | + $this->_params['highlight'] = new \stdClass(); |
|
112 | 112 | return $this; |
113 | 113 | } |
114 | 114 | $this->_params['highlight'] = []; |
115 | 115 | if (count($fields) > 0) { |
116 | - $this->_params['highlight']['fields'] =$fields; |
|
116 | + $this->_params['highlight']['fields'] = $fields; |
|
117 | 117 | } |
118 | - if(count($settings)>0) { |
|
119 | - foreach($settings as $name=>$value) |
|
118 | + if (count($settings) > 0) { |
|
119 | + foreach ($settings as $name=>$value) |
|
120 | 120 | { |
121 | - $this->_params['highlight'][$name] =$value; |
|
121 | + $this->_params['highlight'][$name] = $value; |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | return $this; |
@@ -38,15 +38,15 @@ discard block |
||
38 | 38 | public function __construct($client) |
39 | 39 | { |
40 | 40 | $this->_client = $client; |
41 | - $this->_params =['responseClass'=>'Manticoresearch\\Response\\SqlToArray']; |
|
41 | + $this->_params = ['responseClass'=>'Manticoresearch\\Response\\SqlToArray']; |
|
42 | 42 | } |
43 | 43 | |
44 | - public function agentstatus($params=[]) |
|
44 | + public function agentstatus($params = []) |
|
45 | 45 | { |
46 | 46 | $body = $params['body']??[]; |
47 | 47 | $endpoint = new AgentStatus(); |
48 | 48 | $endpoint->setBody($body); |
49 | - $response = $this->_client->request($endpoint,$this->_params); |
|
49 | + $response = $this->_client->request($endpoint, $this->_params); |
|
50 | 50 | return $response->getResponse(); |
51 | 51 | } |
52 | 52 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $body = $params['body']; |
56 | 56 | $endpoint = new CreateFunction(); |
57 | 57 | $endpoint->setBody($body); |
58 | - $response = $this->_client->request($endpoint,$this->_params); |
|
58 | + $response = $this->_client->request($endpoint, $this->_params); |
|
59 | 59 | return $response->getResponse(); |
60 | 60 | } |
61 | 61 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $body = $params['body']; |
65 | 65 | $endpoint = new CreatePlugin(); |
66 | 66 | $endpoint->setBody($body); |
67 | - $response = $this->_client->request($endpoint,$this->_params); |
|
67 | + $response = $this->_client->request($endpoint, $this->_params); |
|
68 | 68 | return $response->getResponse(); |
69 | 69 | } |
70 | 70 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $body = $params['body']; |
74 | 74 | $endpoint = new Debug(); |
75 | 75 | $endpoint->setBody($body); |
76 | - $response = $this->_client->request($endpoint,$this->_params); |
|
76 | + $response = $this->_client->request($endpoint, $this->_params); |
|
77 | 77 | return $response->getResponse(); |
78 | 78 | } |
79 | 79 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $body = $params['body']; |
83 | 83 | $endpoint = new DropFunction(); |
84 | 84 | $endpoint->setBody($body); |
85 | - $response = $this->_client->request($endpoint,$this->_params); |
|
85 | + $response = $this->_client->request($endpoint, $this->_params); |
|
86 | 86 | return $response->getResponse(); |
87 | 87 | } |
88 | 88 | |
@@ -91,61 +91,61 @@ discard block |
||
91 | 91 | $body = $params['body']; |
92 | 92 | $endpoint = new DropPlugin(); |
93 | 93 | $endpoint->setBody($body); |
94 | - $response = $this->_client->request($endpoint,$this->_params); |
|
94 | + $response = $this->_client->request($endpoint, $this->_params); |
|
95 | 95 | return $response->getResponse(); |
96 | 96 | } |
97 | 97 | |
98 | - public function flushattributes($params=[]) |
|
98 | + public function flushattributes($params = []) |
|
99 | 99 | { |
100 | 100 | $body = $params['body']??[]; |
101 | 101 | $endpoint = new FlushAttributes(); |
102 | 102 | $endpoint->setBody($body); |
103 | - $response = $this->_client->request($endpoint,$this->_params); |
|
103 | + $response = $this->_client->request($endpoint, $this->_params); |
|
104 | 104 | return $response->getResponse(); |
105 | 105 | } |
106 | 106 | |
107 | - public function flushhostnames($params=[]) |
|
107 | + public function flushhostnames($params = []) |
|
108 | 108 | { |
109 | 109 | $body = $params['body']??[]; |
110 | 110 | $endpoint = new FlushHostnames(); |
111 | 111 | $endpoint->setBody($body); |
112 | - $response = $this->_client->request($endpoint,$this->_params); |
|
112 | + $response = $this->_client->request($endpoint, $this->_params); |
|
113 | 113 | return $response->getResponse(); |
114 | 114 | } |
115 | 115 | |
116 | - public function flushlogs($params=[]) |
|
116 | + public function flushlogs($params = []) |
|
117 | 117 | { |
118 | 118 | $body = $params['body']??[]; |
119 | 119 | $endpoint = new FlushLogs(); |
120 | 120 | $endpoint->setBody($body); |
121 | - $response = $this->_client->request($endpoint,$this->_params); |
|
121 | + $response = $this->_client->request($endpoint, $this->_params); |
|
122 | 122 | return $response->getResponse(); |
123 | 123 | } |
124 | 124 | |
125 | - public function plugins($params=[]) |
|
125 | + public function plugins($params = []) |
|
126 | 126 | { |
127 | 127 | $body = $params['body']??[]; |
128 | 128 | $endpoint = new Plugins(); |
129 | 129 | $endpoint->setBody($body); |
130 | - $response = $this->_client->request($endpoint,$this->_params); |
|
130 | + $response = $this->_client->request($endpoint, $this->_params); |
|
131 | 131 | return $response->getResponse(); |
132 | 132 | } |
133 | 133 | |
134 | - public function reloadindexes($params=[]) |
|
134 | + public function reloadindexes($params = []) |
|
135 | 135 | { |
136 | 136 | $body = $params['body']??[]; |
137 | 137 | $endpoint = new ReloadIndexes(); |
138 | 138 | $endpoint->setBody($body); |
139 | - $response = $this->_client->request($endpoint,$this->_params); |
|
139 | + $response = $this->_client->request($endpoint, $this->_params); |
|
140 | 140 | return $response->getResponse(); |
141 | 141 | } |
142 | 142 | |
143 | - public function reloadplugins($params=[]) |
|
143 | + public function reloadplugins($params = []) |
|
144 | 144 | { |
145 | 145 | $body = $params['body']??[]; |
146 | 146 | $endpoint = new ReloadPlugins(); |
147 | 147 | $endpoint->setBody($body); |
148 | - $response = $this->_client->request($endpoint,$this->_params); |
|
148 | + $response = $this->_client->request($endpoint, $this->_params); |
|
149 | 149 | return $response->getResponse(); |
150 | 150 | } |
151 | 151 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $body = $params['body']; |
155 | 155 | $endpoint = new Set(); |
156 | 156 | $endpoint->setBody($body); |
157 | - $response = $this->_client->request($endpoint,$this->_params); |
|
157 | + $response = $this->_client->request($endpoint, $this->_params); |
|
158 | 158 | return $response->getResponse(); |
159 | 159 | } |
160 | 160 | |
@@ -162,40 +162,40 @@ discard block |
||
162 | 162 | * @param array $params |
163 | 163 | * @return mixed |
164 | 164 | */ |
165 | - public function status($params=[]) |
|
165 | + public function status($params = []) |
|
166 | 166 | { |
167 | 167 | $body = $params['body']??[]; |
168 | 168 | $endpoint = new Status(); |
169 | 169 | $endpoint->setBody($body); |
170 | - $response = $this->_client->request($endpoint,$this->_params); |
|
170 | + $response = $this->_client->request($endpoint, $this->_params); |
|
171 | 171 | return $response->getResponse(); |
172 | 172 | |
173 | 173 | } |
174 | 174 | |
175 | - public function tables($params=[]) |
|
175 | + public function tables($params = []) |
|
176 | 176 | { |
177 | 177 | $body = $params['body']??[]; |
178 | 178 | $endpoint = new Tables(); |
179 | 179 | $endpoint->setBody($body); |
180 | - $response = $this->_client->request($endpoint,$this->_params); |
|
180 | + $response = $this->_client->request($endpoint, $this->_params); |
|
181 | 181 | return $response->getResponse(); |
182 | 182 | } |
183 | 183 | |
184 | - public function threads($params=[]) |
|
184 | + public function threads($params = []) |
|
185 | 185 | { |
186 | 186 | $body = $params['body']??[]; |
187 | 187 | $endpoint = new Threads(); |
188 | 188 | $endpoint->setBody($body); |
189 | - $response = $this->_client->request($endpoint,$this->_params); |
|
189 | + $response = $this->_client->request($endpoint, $this->_params); |
|
190 | 190 | return $response->getResponse(); |
191 | 191 | } |
192 | 192 | |
193 | - public function variables($params=[]) |
|
193 | + public function variables($params = []) |
|
194 | 194 | { |
195 | 195 | $body = $params['body']??[]; |
196 | 196 | $endpoint = new Variables(); |
197 | 197 | $endpoint->setBody($body); |
198 | - $response = $this->_client->request($endpoint,$this->_params); |
|
198 | + $response = $this->_client->request($endpoint, $this->_params); |
|
199 | 199 | return $response->getResponse(); |
200 | 200 | } |
201 | 201 | } |
202 | 202 | \ No newline at end of file |
@@ -7,7 +7,7 @@ |
||
7 | 7 | |
8 | 8 | class Range extends Query |
9 | 9 | { |
10 | - public function __construct($field, $args=[]) |
|
10 | + public function __construct($field, $args = []) |
|
11 | 11 | { |
12 | 12 | $this->_params['range'] = [$field => $args]; |
13 | 13 | } |
@@ -9,6 +9,6 @@ |
||
9 | 9 | { |
10 | 10 | public function __construct($keywords, $fields) |
11 | 11 | { |
12 | - $this->_params['match'] =[$fields => $keywords]; |
|
12 | + $this->_params['match'] = [$fields => $keywords]; |
|
13 | 13 | } |
14 | 14 | } |
@@ -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) |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | public function getTransportHandler(LoggerInterface $logger) |
174 | 174 | { |
175 | - return Transport::create($this->getTransport(), $this,$logger); |
|
175 | + return Transport::create($this->getTransport(), $this, $logger); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
@@ -192,9 +192,9 @@ discard block |
||
192 | 192 | * @return mixed|null |
193 | 193 | * |
194 | 194 | */ |
195 | - public function getConfig($key = null) |
|
195 | + public function getConfig($key = null) |
|
196 | 196 | { |
197 | - if($key === null) { |
|
197 | + if ($key === null) { |
|
198 | 198 | return $this->config; |
199 | 199 | } |
200 | 200 | return $this->config[$key] ?? null; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | protected $_response; |
46 | 46 | |
47 | - public function __construct( $responseString, $status = null) |
|
47 | + public function __construct($responseString, $status = null) |
|
48 | 48 | { |
49 | 49 | if (is_array($responseString)) { |
50 | 50 | $this->_response = $responseString; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | public function hasError() |
81 | 81 | { |
82 | 82 | $response = $this->getResponse(); |
83 | - return (isset($response['error']) && $response['error'] !== '') || (isset($response['errors']) && $response['errors'] !== false); |
|
83 | + return (isset($response['error']) && $response['error'] !== '') || (isset($response['errors']) && $response['errors'] !== false); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /* |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $response = $this->getResponse(); |
93 | 93 | if (isset($response['error'])) { |
94 | 94 | return json_encode($response['error'], true); |
95 | - } elseif (isset($response['errors'])){ |
|
95 | + } elseif (isset($response['errors'])) { |
|
96 | 96 | return json_encode($response['errors'], true); |
97 | 97 | } else { |
98 | 98 | return ''; |