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

ProxyProductionFailed::tryingToProduceFor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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