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

bonu-dev / php-elasticsearch-builder / 19805186840

30 Nov 2025 09:34PM UTC coverage: 99.567%. First build
19805186840

Pull #1

github

web-flow
Merge 856f79dce into cff11ae97
Pull Request #1: Initial implementation

230 of 231 new or added lines in 13 files covered. (99.57%)

230 of 231 relevant lines covered (99.57%)

4.53 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