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

mimmi20 / browser-detector / 16586424616

28 Jul 2025 09:40PM UTC coverage: 93.057% (+0.5%) from 92.551%
16586424616

push

github

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

add new devices

551 of 551 new or added lines in 8 files covered. (100.0%)

1 existing line in 1 file now uncovered.

5844 of 6280 relevant lines covered (93.06%)

12.09 hits per line

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

90.0
/src/Parser/Header/SecChUaClientVersion.php
1
<?php
2

3
/**
4
 * This file is part of the browser-detector package.
5
 *
6
 * Copyright (c) 2012-2025, 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 Override;
17
use UaParser\ClientVersionInterface;
18

19
use function reset;
20

21
final class SecChUaClientVersion implements ClientVersionInterface
22
{
23
    use SortTrait;
24

25
    /** @throws void */
26
    #[Override]
40✔
27
    public function hasClientVersion(string $value): bool
28
    {
29
        return $this->sort($value) !== [];
40✔
30
    }
31

32
    /**
33
     * @return non-empty-string|null
34
     *
35
     * @throws void
36
     *
37
     * @phpcs:disable SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
38
     */
39
    #[Override]
40✔
40
    public function getClientVersion(string $value, string | null $code = null): string | null
41
    {
42
        $list = $this->sort($value);
40✔
43

44
        if ($list === []) {
40✔
45
            return null;
4✔
46
        }
47

48
        $version = reset($list);
36✔
49

50
        if ($version === '') {
36✔
UNCOV
51
            return null;
×
52
        }
53

54
        return $version;
36✔
55
    }
56
}
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