Completed
Push — master ( cd03ce...a0b884 )
by Jesse
02:19
created

ProxyProductionFailed   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A tryingToProduceFor() 0 13 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stratadox\Hydration\Mapping\Property\Relationship;
6
7
use RuntimeException;
8
use function sprintf;
9
use Stratadox\Hydration\MapsProperty;
10
use Stratadox\Hydration\UnmappableInput;
11
use Throwable;
12
13
final class ProxyProductionFailed extends RuntimeException implements UnmappableInput
14
{
15
    public static function tryingToProduceFor(
16
        MapsProperty $mapping,
17
        Throwable $exception
18
    ) : self
19
    {
20
        return new self(
21
            sprintf(
22
                'Proxy production for in the `%s` property failed: %s',
23
                $mapping->name(),
24
                $exception->getMessage()
25
            ),
26
            0,
27
            $exception
28
        );
29
    }
30
}
31