• 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

85.71
/src/Loader/CompanyLoader.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\Loader;
15

16
use Override;
17
use RuntimeException;
18
use UaLoader\Exception\NotFoundException;
19
use UaResult\Company\Company;
20

21
final readonly class CompanyLoader implements CompanyLoaderInterface
22
{
23
    /** @throws void */
24
    public function __construct(private Data\Company $initData)
3✔
25
    {
26
        // nothing to do
27
    }
3✔
28

29
    /** @throws NotFoundException */
30
    #[Override]
3✔
31
    public function load(string $key): Company
32
    {
33
        try {
34
            $this->initData->init();
3✔
NEW
35
        } catch (RuntimeException $e) {
×
NEW
36
            throw new NotFoundException('the company with key "' . $key . '" was not found', 0, $e);
×
37
        }
38

39
        $companyData = $this->initData->getItem($key);
3✔
40

41
        if ($companyData === null) {
3✔
42
            throw new NotFoundException('the company with key "' . $key . '" was not found');
2✔
43
        }
44

45
        return new Company(
1✔
46
            type: $key,
1✔
47
            name: $companyData->getName(),
1✔
48
            brandname: $companyData->getBrandname(),
1✔
49
        );
1✔
50
    }
51
}
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