@@ -11,7 +11,7 @@ |
||
| 11 | 11 | $response = parent::getResponse(); |
| 12 | 12 | if (isset($response['columns'], $response['data'])) { |
| 13 | 13 | $data = []; |
| 14 | - array_walk($response['columns'], static function (&$value, $key) { |
|
| 14 | + array_walk($response['columns'], static function(&$value, $key) { |
|
| 15 | 15 | $value = array_keys($value)[0]; |
| 16 | 16 | }); |
| 17 | 17 | foreach ($response['data'] as $property) { |
@@ -108,17 +108,17 @@ |
||
| 108 | 108 | public function highlight($fields = [], $settings = []): self |
| 109 | 109 | { |
| 110 | 110 | |
| 111 | - if (count($fields) === 0 && count($settings)===0) { |
|
| 112 | - $this->params['highlight'] = new \stdClass(); |
|
| 111 | + if (count($fields) === 0 && count($settings) === 0) { |
|
| 112 | + $this->params['highlight'] = new \stdClass(); |
|
| 113 | 113 | return $this; |
| 114 | 114 | } |
| 115 | 115 | $this->params['highlight'] = []; |
| 116 | 116 | if (count($fields) > 0) { |
| 117 | - $this->params['highlight']['fields'] =$fields; |
|
| 117 | + $this->params['highlight']['fields'] = $fields; |
|
| 118 | 118 | } |
| 119 | - if (count($settings)>0) { |
|
| 119 | + if (count($settings) > 0) { |
|
| 120 | 120 | foreach ($settings as $name => $value) { |
| 121 | - $this->params['highlight'][$name] =$value; |
|
| 121 | + $this->params['highlight'][$name] = $value; |
|
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | return $this; |
@@ -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 | } |
@@ -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 | ] |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $connection = $this->getConnection(); |
| 34 | 34 | $conn = $this->getCurlConnection($connection->getConfig('persistent')); |
| 35 | - $url = $this->scheme.'://'.$connection->getHost().':'.$connection->getPort(); |
|
| 35 | + $url = $this->scheme . '://' . $connection->getHost() . ':' . $connection->getPort(); |
|
| 36 | 36 | $endpoint = $request->getPath(); |
| 37 | 37 | $url .= $endpoint; |
| 38 | 38 | $url = $this->setupURI($url, $request->getQuery()); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | curl_setopt($conn, CURLOPT_CUSTOMREQUEST, $method); |
| 59 | 59 | curl_setopt($conn, CURLOPT_HTTPHEADER, $headers); |
| 60 | 60 | |
| 61 | - if ($connection->getConnectTimeout()>0) { |
|
| 61 | + if ($connection->getConnectTimeout() > 0) { |
|
| 62 | 62 | curl_setopt($conn, CURLOPT_CONNECTTIMEOUT, $connection->getConnectTimeout()); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | curl_setopt( |
| 68 | 68 | $conn, |
| 69 | 69 | CURLOPT_USERPWD, |
| 70 | - $connection->getConfig('username').":".$connection->getConfig('password') |
|
| 70 | + $connection->getConfig('username') . ":" . $connection->getConfig('password') |
|
| 71 | 71 | ); |
| 72 | 72 | } |
| 73 | 73 | if ($connection->getConfig('proxy') !== null) { |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | 'body' => $request->getBody() |
| 101 | 101 | ]); |
| 102 | 102 | //hard error |
| 103 | - if ($errorno>0) { |
|
| 103 | + if ($errorno > 0) { |
|
| 104 | 104 | $error = curl_error($conn); |
| 105 | 105 | |
| 106 | 106 | /* @phpstan-ignore-next-line */ |
@@ -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) { |