InvalidConfigException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A invalidOptionValue() 0 10 1
1
<?php
2
3
/**
4
 * Static Analysis Results Baseliner (sarb).
5
 *
6
 * (c) Dave Liddament
7
 *
8
 * For the full copyright and licence information please view the LICENSE file distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Framework\Command\internal;
14
15
/**
16
 * Used for invalid user config provided.
17
 */
18
final class InvalidConfigException extends \Exception
19
{
20
    /**
21
     * @param string[] $validOptions
22
     */
23
    public static function invalidOptionValue(string $option, string $value, array $validOptions): self
24
    {
25
        $message = sprintf(
26
            'Invalid value [%s] for option [%s]. Pick one of: %s',
27
            $value,
28
            $option,
29
            implode('|', $validOptions),
30
        );
31
32
        return new self($message);
33
    }
34
}
35