• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bonu-dev / php-elasticsearch-builder / 19804015544

30 Nov 2025 07:51PM UTC coverage: 98.605%. First build
19804015544

Pull #1

github

web-flow
Merge ec391d9ac into cff11ae97
Pull Request #1: TBA

212 of 215 new or added lines in 12 files covered. (98.6%)

212 of 215 relevant lines covered (98.6%)

4.09 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
/src/Query/BoostableQuery.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Bonu\ElasticsearchBuilder\Query;
6

7
trait BoostableQuery
8
{
9
    /**
10
     * @var float
11
     */
12
    protected float $boost = 1.0;
13

14
    /**
15
     * @param float $boost
16
     *
17
     * @return $this
18
     */
19
    public function boost(float $boost): static
4✔
20
    {
21
        $this->boost = $boost;
4✔
22
        return $this;
4✔
23
    }
24

25
    /**
26
     * @param array<string, mixed> $query
27
     *
28
     * @return array<string, mixed>
29
     */
30
    protected function addBoostToQuery(array $query): array
16✔
31
    {
32
        if ($this->boost === null) {
16✔
NEW
33
            return $query;
×
34
        }
35

36
        return [
16✔
37
            ...$query,
16✔
38
            'boost' => $this->boost,
16✔
39
        ];
16✔
40
    }
41
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc