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

mimmi20 / browser-detector / 26619626009

29 May 2026 05:20AM UTC coverage: 96.478% (-0.01%) from 96.488%
26619626009

push

github

web-flow
Merge pull request #1058 from mimmi20/dependabot/composer/development-dependencies-f926ab8d74

composer (master)(deps-dev): bump the development-dependencies group with 7 updates

15285 of 15843 relevant lines covered (96.48%)

157.91 hits per line

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

0.0
/src/Parser/Header/SecChUaEngineCode.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\Data\Engine;
17
use Override;
18
use UaData\EngineInterface;
19
use UaParser\EngineCodeInterface;
20

21
use function array_key_first;
22
use function mb_strtolower;
23

24
final class SecChUaEngineCode implements EngineCodeInterface
25
{
26
    use SortTrait;
27

28
    /** @throws void */
29
    #[Override]
30
    public function hasEngineCode(string $value): bool
×
31
    {
32
        return $this->sortForEngine($value) !== [];
×
33
    }
34

35
    /** @throws void */
36
    #[Override]
37
    public function getEngineCode(string $value): EngineInterface
×
38
    {
39
        $list = $this->sortForEngine($value);
×
40

41
        if ($list === []) {
×
42
            return Engine::unknown;
×
43
        }
44

45
        $key  = array_key_first($list);
×
46
        $code = mb_strtolower($key);
×
47

48
        return match ($code) {
49
            'safari' => Engine::webkit,
×
50
            default => Engine::blink,
×
51
        };
52
    }
53
}
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