HasBoost   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 34
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A hasBoost() 0 3 1
A getBoost() 0 3 1
A setBoost() 0 5 1
1
<?php
2
3
namespace Nord\Lumen\Elasticsearch\Search\Query\Traits;
4
5
/**
6
 * Trait BoostableQuery
7
 * @package Nord\Lumen\Elasticsearch\Search\Query\Traits
8
 */
9
trait HasBoost
10
{
11
12
    /**
13
     * @var ?float Sets the boost value of the query, defaults to 1.0.
14
     */
15
    protected $boost;
16
17
    /**
18
     * @return float|null
19
     */
20
    public function getBoost()
21
    {
22
        return $this->boost;
23
    }
24
25
    /**
26
     * @param float $boost
27
     *
28
     * @return $this
29
     */
30
    public function setBoost(float $boost)
31
    {
32
        $this->boost = $boost;
33
34
        return $this;
35
    }
36
37
    /**
38
     * @return bool
39
     */
40
    public function hasBoost()
41
    {
42
        return $this->boost !== null;
43
    }
44
}
45