Test Failed
Push — main ( 8bbfd5...5b42e4 )
by Fractal
03:27
created

ExceptionMapperException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A notMatchedGroup() 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 ExceptionMapperException extends \LogicException
11
{
12
    private const NOT_MATCHED_GROUP_MESSAGE = 'Regex group "%s" not matched in "%s" exception with message "%s"';
13
14
    public static function notMatchedGroup(string $groupName, \Throwable $previous): self
15
    {
16
        $message = sprintf(self::NOT_MATCHED_GROUP_MESSAGE, $groupName, $previous::class, $previous->getMessage());
17
18
        return new self($message, previous: $previous);
19
    }
20
}
21