@@ -131,7 +131,7 @@ |
||
131 | 131 | * Для удобства используй готовые методы фильтрации: where(), whereIn(), whereBetween(), whereMatch() |
132 | 132 | * whereLess() и другие методы where*() |
133 | 133 | * |
134 | - * @param $type - тип фильтрации (term|terms|match|range) |
|
134 | + * @param string $type - тип фильтрации (term|terms|match|range) |
|
135 | 135 | * @param $filter - сам фильтр |
136 | 136 | * @link https://www.elastic.co/guide/en/elasticsearch/reference/5.0/query-dsl-terms-query.html |
137 | 137 | * @return $this |
@@ -321,8 +321,7 @@ discard block |
||
321 | 321 | 'query' => $text, |
322 | 322 | 'fields' => $field |
323 | 323 | ]); |
324 | - } |
|
325 | - else { |
|
324 | + } else { |
|
326 | 325 | $this->addFilter('match', [$field => $text]); |
327 | 326 | } |
328 | 327 | return $this; |
@@ -431,8 +430,7 @@ discard block |
||
431 | 430 | foreach ($hit['fields'] as $field => $data) { |
432 | 431 | if (count($data) == 1) { |
433 | 432 | $row[$field] = array_shift($data); |
434 | - } |
|
435 | - else { |
|
433 | + } else { |
|
436 | 434 | $row[$field] = $data; |
437 | 435 | } |
438 | 436 | } |
@@ -455,8 +453,7 @@ discard block |
||
455 | 453 | $results = $this->fetchAll(); |
456 | 454 | if (count($results)) { |
457 | 455 | return array_shift($results); |
458 | - } |
|
459 | - else { |
|
456 | + } else { |
|
460 | 457 | return null; |
461 | 458 | } |
462 | 459 | } |