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

mimmi20 / browser-detector / 12945342151

22 Jan 2025 07:24PM UTC coverage: 89.212% (-10.8%) from 100.0%
12945342151

push

github

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

rewrite Headers

2983 of 3466 new or added lines in 72 files covered. (86.06%)

9 existing lines in 2 files now uncovered.

4234 of 4746 relevant lines covered (89.21%)

11.89 hits per line

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

0.0
/src/Parser/Header/CrawledByClientCode.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\ClientCodeInterface;
18

19
use function array_key_first;
20
use function mb_strtolower;
21
use function str_contains;
22

23
final class CrawledByClientCode implements ClientCodeInterface
24
{
25
    use SortTrait;
26

27
    /** @throws void */
NEW
28
    #[Override]
×
29
    public function hasClientCode(string $value): bool
30
    {
NEW
31
        $list = $this->sort($value);
×
32

NEW
33
        if ($list === null || $list === []) {
×
NEW
34
            return false;
×
35
        }
36

NEW
37
        $key  = array_key_first($list);
×
NEW
38
        $code = mb_strtolower($key);
×
39

NEW
40
        return !str_contains($code, 'brand') && $code !== 'chromium';
×
41
    }
42

43
    /**
44
     * @return non-empty-string|null
45
     *
46
     * @throws void
47
     *
48
     * @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
49
     */
NEW
50
    #[Override]
×
51
    public function getClientCode(string $value): string | null
52
    {
NEW
53
        return null;
×
54
    }
55
}
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