LocalePresetException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 16
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace League\Emoji\Exception;
6
7
class LocalePresetException extends \RuntimeException implements EmojiException
8
{
9
    /**
10
     * @param \Throwable[] $throwables
11
     */
12 399
    public function __construct(string $locale, array $throwables = [])
13
    {
14 399
        $reasons = [];
15 399
        foreach ($throwables as $preset => $throwable) {
16 399
            $reasons[] = \sprintf('%s: %s', $preset, $throwable->getMessage());
17
        }
18
19 399
        parent::__construct(\sprintf(
20
            "Attempted to load the locale \"%s\" dataset. However, the following preset(s) were unable to be loaded:\n%s",
21 399
            $locale,
22 399
            \implode("\n", $reasons)
23
        ));
24 399
    }
25
}
26