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

InvalidArgumentException::oneOfCommandArguments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
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
use InvalidArgumentException as BaseInvalidArgumentException;
15
16
/**
17
 * Exception to handle errors if one argument is required
18
 */
19
final class InvalidArgumentException extends BaseInvalidArgumentException
20
{
21 1
    public static function oneOfCommandArguments(string ...$requiredArguments) : self
22
    {
23 1
        return new self(
24 1
            sprintf('One of the command arguments "%s" is required', implode('", "', $requiredArguments))
25
        );
26
    }
27
}
28