Skip to content
Snippets Groups Projects
Commit fbefdd5a authored by Linas Mockus's avatar Linas Mockus
Browse files

CS and few scrutinizer issues fixes

parent 6aac12e3
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,7 @@ class RangeAggregation extends AbstractAggregation
*/
public function addRange($from = null, $to = null, $key = '')
{
$range = [];
$range = [];
if (!empty($from)) {
$range['from'] = $from;
......
......@@ -11,6 +11,9 @@
namespace ONGR\ElasticsearchBundle\DSL\Aggregation\Type;
/**
* Trait used by Aggregations which supports nesting.
*/
trait BucketingTrait
{
/**
......
......@@ -11,6 +11,9 @@
namespace ONGR\ElasticsearchBundle\DSL\Aggregation\Type;
/**
* Trait used by Aggregations which do not support nesting.
*/
trait MetricTrait
{
/**
......
......@@ -11,6 +11,9 @@
namespace ONGR\ElasticsearchBundle\DSL;
/**
* Interface BuilderInterface.
*/
interface BuilderInterface
{
/**
......
......@@ -74,6 +74,7 @@ abstract class AbstractFilter
*/
public function toArray()
{
$output = [];
$output[$this->filters->getType()] = $this->filters->toArray();
return $output;
......
......@@ -54,6 +54,7 @@ class QueryFilter implements BuilderInterface
public function toArray()
{
if ($this->hasParameter('_cache')) {
$query = [];
$query['query'] = [$this->query->getType() => $this->query->toArray()];
$output = $this->processArray($query);
......
......@@ -27,7 +27,7 @@ class FilteredQuery extends AbstractFilter implements BuilderInterface
private $query;
/**
* @param Query $query
* @param Query $query
*/
public function __construct($query = null)
{
......@@ -68,6 +68,7 @@ class FilteredQuery extends AbstractFilter implements BuilderInterface
*/
public function toArray()
{
$output = [];
$output['filter'] = parent::toArray();
if ($this->query !== null) {
......
......@@ -74,7 +74,7 @@ class Completion extends AbstractSuggester
);
$completion = [
'field' => $this->getField()
'field' => $this->getField(),
];
if (empty($fuzzy) && $this->isFuzzy()) {
......
......@@ -75,7 +75,7 @@ class Term extends AbstractSuggester
'size' => $this->getSize(),
'term' => $suggester,
]
)
),
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment