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

bonu-dev / php-elasticsearch-builder / 19804946792

30 Nov 2025 09:13PM UTC coverage: 98.649%. First build
19804946792

Pull #1

github

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

219 of 222 new or added lines in 12 files covered. (98.65%)

219 of 222 relevant lines covered (98.65%)

4.06 hits per line

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

90.91
/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 static
18
     */
19
    public function boost(float $boost): static
4✔
20
    {
21
        $clone = clone $this;
4✔
22
        $clone->boost = $boost;
4✔
23

24
        return $clone;
4✔
25
    }
26

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

38
        return [
16✔
39
            ...$query,
16✔
40
            'boost' => $this->boost,
16✔
41
        ];
16✔
42
    }
43
}
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