Completed
Push — develop ( 6a501c...d1beb9 )
by Sam
05:58 queued 02:56
created

ConstantScoreQuery   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 6 1
1
<?php
2
3
namespace Nord\Lumen\Elasticsearch\Search\Query\Compound;
4
5
use Nord\Lumen\Elasticsearch\Search\Query\Traits\HasBoost;
6
use Nord\Lumen\Elasticsearch\Search\Query\Traits\HasQuery;
7
8
/**
9
 * Class ConstantScoreQuery
10
 * @package Nord\Lumen\Elasticsearch\Search\Query\Compound
11
 */
12
class ConstantScoreQuery extends AbstractQuery
13
{
14
    use HasQuery;
15
    use HasBoost;
16
17
    /**
18
     * @inheritdoc
19
     */
20
    public function toArray()
21
    {
22
        return [
23
            'constant_score' => [
24
                'filter' => $this->getQuery()->toArray(),
25
                'boost'  => $this->getBoost(),
26
            ],
27
        ];
28
    }
29
}
30