InvalidPropertyTypeException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

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

1 Method

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