Passed
Push — master ( fd6ae4...b59e9d )
by Carlos C
01:58
created

GenericOverrideException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A formatGenericMessage() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Eclipxe\Enum\Exceptions;
6
7
use OutOfRangeException;
8
use Throwable;
9
10
abstract class GenericOverrideException extends OutOfRangeException implements EnumExceptionInterface
11
{
12
    /**
13
     * @param string $className
14
     * @param string $value
15
     * @param Throwable|null $previous
16
     * @return static
17
     */
18
    abstract public static function create(string $className, string $value, Throwable $previous = null);
19
20 2
    protected static function formatGenericMessage(string $className, string $typeName, string $value): string
21
    {
22 2
        return sprintf('%s cannot override %s to %s', $className, $typeName, $value);
23
    }
24
}
25