Completed
Pull Request — develop (#75)
by Sam
02:37
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
15
    use HasQuery;
16
    use HasBoost;
17
18
    /**
19
     * @inheritdoc
20
     */
21
    public function toArray()
22
    {
23
        return [
24
            'constant_score' => [
25
                'filter' => $this->getQuery()->toArray(),
26
                'boost'  => $this->getBoost(),
27
            ],
28
        ];
29
    }
30
31
}
32