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

ConstantScoreQuery::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 6
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
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