DuplicatedEnumException::alreadyRegistered()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yokai\EnumBundle\Exception;
6
7
use BadMethodCallException;
8
9
/**
10
 * @author Yann Eugoné <[email protected]>
11
 */
12
class DuplicatedEnumException extends BadMethodCallException
13
{
14
    /**
15
     * @param string $name
16
     *
17
     * @return DuplicatedEnumException
0 ignored issues
show
Documentation introduced by
Should the return type not be \self?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
18
     */
19
    public static function alreadyRegistered(string $name): self
20
    {
21
        return new self(sprintf('Enum with name "%s" is already registered', $name));
22
    }
23
}
24