InvalidConfigPathException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
1
<?php declare(strict_types=1);
2
3
namespace Diezz\YamlToObjectMapper;
4
5
use RuntimeException;
6
7
class InvalidConfigPathException extends RuntimeException
8
{
9
    public function __construct(array $config, ClassInfo $classInfo)
10
    {
11
        $message = "Yaml file contains properties that doesn't exists on a target class {$classInfo->getClassName()}:";
12
        foreach (array_keys($config) as $fieldName) {
13
            $message .= "\n- $fieldName";
14
        }
15
        $message .= "\nTo prevent this behaviour use #[IgnoreUnknown] on a target class";
16
        parent::__construct($message);
17
    }
18
}
19