FactoryConfigException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A withMissingKey() 0 6 1
1
<?php
2
3
/**
4
 * Copyright (c) Florian Krämer (https://florian-kraemer.net)
5
 * Licensed under The MIT License
6
 * For full copyright and license information, please see the LICENSE.txt
7
 * Redistributions of files must retain the above copyright notice.
8
 *
9
 * @copyright Copyright (c) Florian Krämer (https://florian-kraemer.net)
10
 * @author    Florian Krämer
11
 * @link      https://github.com/Phauthentic
12
 * @license   https://opensource.org/licenses/MIT MIT License
13
 */
14
15
declare(strict_types=1);
16
17
namespace Phauthentic\Infrastructure\Storage\Factories\Exception;
18
19
use Phauthentic\Infrastructure\Storage\Exception\StorageException;
20
use Phauthentic\Infrastructure\Storage\Factories\FactoryInterface;
21
22
/**
23
 * FactoryConfigException
24
 */
25
class FactoryConfigException extends FactoryException
26
{
27
    public static function withMissingKey(string $key, FactoryInterface $factory)
28
    {
29
        return new self(sprintf(
30
            'Config key `%s` for `%s` is empty or missing',
31
            $key,
32
            get_class($factory)
33
        ));
34
    }
35
}
36