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

InvalidArgumentException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 9
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A oneOfCommandArguments() 0 6 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