@@ -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; |
@@ -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 ''; |
@@ -87,7 +87,7 @@ |
||
87 | 87 | $this->_logger->info( |
88 | 88 | 'Request:', |
89 | 89 | [ |
90 | - 'url' => $url, |
|
90 | + 'url' => $url, |
|
91 | 91 | 'status' => $status, |
92 | 92 | 'time' => $time |
93 | 93 | ] |
@@ -41,7 +41,7 @@ |
||
41 | 41 | * @return Response |
42 | 42 | * @throws \Http\Client\Exception |
43 | 43 | */ |
44 | - public function execute(Request $request, $params=[]) |
|
44 | + public function execute(Request $request, $params = []) |
|
45 | 45 | { |
46 | 46 | $connection = $this->getConnection(); |
47 | 47 |
@@ -159,13 +159,13 @@ |
||
159 | 159 | * @param bool $obj |
160 | 160 | * @return array|Response |
161 | 161 | */ |
162 | - public function search(array $params = [],$obj=false) |
|
162 | + public function search(array $params = [], $obj = false) |
|
163 | 163 | { |
164 | 164 | $endpoint = new Endpoints\Search($params); |
165 | 165 | $response = $this->request($endpoint); |
166 | - if($obj ===true) { |
|
166 | + if ($obj === true) { |
|
167 | 167 | return $response; |
168 | - }else{ |
|
168 | + } else { |
|
169 | 169 | return $response->getResponse(); |
170 | 170 | } |
171 | 171 | } |
@@ -165,7 +165,7 @@ |
||
165 | 165 | $response = $this->request($endpoint); |
166 | 166 | if($obj ===true) { |
167 | 167 | return $response; |
168 | - }else{ |
|
168 | + } else{ |
|
169 | 169 | return $response->getResponse(); |
170 | 170 | } |
171 | 171 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | } elseif (is_array($v)) { |
26 | 26 | $return[$k] = $this->_toArray($v); |
27 | 27 | } else { |
28 | - if ($v!==null) { |
|
28 | + if ($v !== null) { |
|
29 | 29 | $return[$k] = $v; |
30 | 30 | } else { |
31 | 31 | return null; |