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

mimmi20 / browser-detector / 21853085316

10 Feb 2026 05:34AM UTC coverage: 95.809% (-0.1%) from 95.958%
21853085316

push

github

web-flow
Merge pull request #1033 from mimmi20/updates

add new client

289 of 319 new or added lines in 21 files covered. (90.6%)

1 existing line in 1 file now uncovered.

12552 of 13101 relevant lines covered (95.81%)

64.22 hits per line

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

0.0
/src/Parser/Header/SecChUaEngineVersion.php
1
<?php
2

3
/**
4
 * This file is part of the browser-detector package.
5
 *
6
 * Copyright (c) 2012-2026, Thomas Mueller <mimmi20@live.de>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types = 1);
13

14
namespace BrowserDetector\Parser\Header;
15

16
use BrowserDetector\Version\ForcedNullVersion;
17
use BrowserDetector\Version\VersionInterface;
18
use Override;
19
use UaData\EngineInterface;
20
use UaParser\EngineVersionInterface;
21

22
use function array_first;
23
use function array_key_first;
24
use function mb_strtolower;
25

26
final class SecChUaEngineVersion implements EngineVersionInterface
27
{
28
    use SetVersionTrait;
29
    use SortTrait;
30

31
    /** @throws void */
NEW
32
    #[Override]
×
33
    public function hasEngineVersion(string $value): bool
34
    {
NEW
35
        return $this->sortForEngine($value) !== [];
×
36
    }
37

38
    /**
39
     * @throws void
40
     *
41
     * @phpcs:disable SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
42
     */
NEW
43
    #[Override]
×
44
    public function getEngineVersionWithEngine(string $value, EngineInterface $engine): VersionInterface
45
    {
NEW
46
        $list = $this->sortForEngine($value);
×
47

NEW
48
        $version = array_first($list);
×
49

NEW
50
        if ($version === null) {
×
NEW
51
            return new ForcedNullVersion();
×
52
        }
53

NEW
54
        $key  = array_key_first($list);
×
NEW
55
        $code = mb_strtolower($key ?? '');
×
56

NEW
57
        return match ($code) {
×
NEW
58
            default => $this->setVersion($version),
×
NEW
59
        };
×
60
    }
61
}
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