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

mimmi20 / ua-generic-request / 12756749395

13 Jan 2025 09:48PM UTC coverage: 88.104%. First build
12756749395

push

github

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

rewrite Headers

81 of 113 new or added lines in 12 files covered. (71.68%)

237 of 269 relevant lines covered (88.1%)

6.11 hits per line

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

0.0
/src/Header/PlatformCodeOnlyHeader.php
1
<?php
2

3
/**
4
 * This file is part of the mimmi20/ua-generic-request package.
5
 *
6
 * Copyright (c) 2015-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 UaRequest\Header;
15

16
use Override;
17
use UaParser\PlatformCodeInterface;
18

19
final class PlatformCodeOnlyHeader implements HeaderInterface
20
{
21
    use HeaderTrait;
22

23
    /** @throws void */
NEW
24
    public function __construct(string $value, private readonly PlatformCodeInterface $platformCode)
×
25
    {
NEW
26
        $this->value = $value;
×
27
    }
28

29
    /** @throws void */
NEW
30
    #[Override]
×
31
    public function hasPlatformCode(): bool
32
    {
NEW
33
        return $this->platformCode->hasPlatformCode($this->value);
×
34
    }
35

36
    /** @throws void */
NEW
37
    #[Override]
×
38
    public function getPlatformCode(string | null $derivate = null): string | null
39
    {
NEW
40
        return $this->platformCode->getPlatformCode($this->value, $derivate);
×
41
    }
42
}
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