Passed
Push — master ( a4ef1c...1fb27f )
by Florian
12:17 queued 12s
created

VariantDoesNotExistException::withName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
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\Processor\Exception;
18
19
/**
20
 * VariantDoesNotExistException
21
 */
22
class VariantDoesNotExistException extends VariantException
23
{
24
    /**
25
     * @param string $name Name
26
     * @return self
27
     */
28 1
    public static function withName(string $name): self
29
    {
30 1
        return new self(sprintf(
31 1
            'A variant with the name `%s` does not exists',
32
            $name
33
        ));
34
    }
35
}
36