CouldNotImplode   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A encountered() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stratadox\ImmutableCollection;
6
7
use function get_class as theClassOf;
8
use RuntimeException;
9
use function sprintf as withMessage;
10
use Stratadox\Collection\Collection;
11
use Stratadox\Collection\ConversionFailed;
12
use Throwable;
13
14
final class CouldNotImplode extends RuntimeException implements ConversionFailed
15
{
16
    public static function encountered(
17
        Collection $theCollection,
18
        Throwable $exception
19
    ): ConversionFailed {
20
        return new CouldNotImplode(withMessage(
21
            'Could not implode the `%s` class: %s',
22
            theClassOf($theCollection),
23
            $exception->getMessage()
24
        ));
25
    }
26
}
27