Completed
Pull Request — master (#221)
by Thomas
28:24 queued 26:59
created

ReaderException::userAgentParserError()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * This file is part of the browscap-php package.
4
 *
5
 * Copyright (c) 1998-2017, Browser Capabilities Project
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types = 1);
12
namespace BrowscapPHP\Exception;
13
14
/**
15
 * Exception to handle errors while reading a log file
16
 */
17
final class ReaderException extends DomainException
18
{
19 1
    public static function userAgentParserError(string $line) : self
20
    {
21 1
        return new self(sprintf('Cannot extract user agent string from line "%s"', $line));
22
    }
23
}
24