InvalidPropertyTypeException::notSupported()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 6
rs 10
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