Test Failed
Push — main ( ab57df...39c21d )
by Fractal
03:48
created

InvalidPropertyTypeException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A notSupported() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FRZB\Component\RequestMapper\Exception;
6
7
use JetBrains\PhpStorm\Immutable;
8
9
#[Immutable]
10
final class InvalidPropertyTypeException extends \InvalidArgumentException
11
{
12
    private const DEFAULT_NOT_SUPPORTED_TYPE_MESSAGE = '%s type is not supported';
13
14
    public static function notSupported(string $typeName, ?\Throwable $previous = null): self
15
    {
16
        $message = sprintf(self::DEFAULT_NOT_SUPPORTED_TYPE_MESSAGE, $typeName);
17
18
        return new self($message, previous: $previous);
19
    }
20
}
21