• 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/PlatformHeader.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
use UaParser\PlatformVersionInterface;
19

20
final class PlatformHeader implements HeaderInterface
21
{
22
    use HeaderTrait;
23

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

33
    /** @throws void */
NEW
34
    #[Override]
×
35
    public function hasPlatformCode(): bool
36
    {
NEW
37
        return $this->platformCode->hasPlatformCode($this->value);
×
38
    }
39

40
    /** @throws void */
NEW
41
    #[Override]
×
42
    public function getPlatformCode(string | null $derivate = null): string | null
43
    {
NEW
44
        return $this->platformCode->getPlatformCode($this->value, $derivate);
×
45
    }
46

47
    /** @throws void */
NEW
48
    #[Override]
×
49
    public function hasPlatformVersion(): bool
50
    {
NEW
51
        return $this->platformVersion->hasPlatformVersion($this->value);
×
52
    }
53

54
    /** @throws void */
NEW
55
    #[Override]
×
56
    public function getPlatformVersion(string | null $code = null): string | null
57
    {
NEW
58
        return $this->platformVersion->getPlatformVersion($this->value, $code);
×
59
    }
60
}
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