HostDetectorException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 13
ccs 4
cts 4
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A becauseGetOptAdapterConfiguredIncorrect() 0 6 1
A becauseEmptyNeedlePassed() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lamoda\MultiEnv\HostDetector\Exception;
6
7
use Lamoda\MultiEnv\Exception\EnvProviderExceptionInterface;
8
9
final class HostDetectorException extends \InvalidArgumentException implements EnvProviderExceptionInterface
10
{
11 6
    public static function becauseEmptyNeedlePassed(string $className): self
12
    {
13 6
        return new self("Empty needle passed to __construct method of $className");
14
    }
15
16 1
    public static function becauseGetOptAdapterConfiguredIncorrect(
17
        string $className,
18
        string $paramName,
19
        string $correctValue
20
    ): self {
21 1
        return new self("$className class configured incorrect. You should set '$paramName' to '$correctValue'");
22
    }
23
}
24