DictionaryNotFoundException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
c 2
b 0
f 0
dl 0
loc 14
ccs 4
cts 4
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Knp\DictionaryBundle\Exception;
6
7
final class DictionaryNotFoundException extends \Exception
8
{
9
    /**
10
     * @param string[] $knowns
11
     */
12
    public function __construct(string $dictionaryName, array $knowns = [], ?\Exception $exception = null)
13
    {
14 3
        $message = \sprintf('The dictionary "%s" has not been found in the registry.', $dictionaryName);
15
16 3
        if ([] !== $knowns) {
17
            $message .= \sprintf(' Known dictionaries are: "%s".', implode('", "', $knowns));
18 3
        }
19 1
20
        parent::__construct($message, 0, $exception);
21
    }
22
}
23