UnknownPropertiesDtoException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
1
<?php
2
3
namespace Larapie\DataTransferObject\Exceptions;
4
5
use RuntimeException;
6
7
class UnknownPropertiesDtoException extends RuntimeException
8
{
9 3
    public function __construct(array $properties, string $className)
10
    {
11 3
        $propertyNames = implode(', ', array_keys($properties));
12 3
        if (count($properties) > 1) {
13 1
            $message = "Parameters {$propertyNames} are not allowed as input on {$className}";
14
        } else {
15 2
            $message = "Parameter {$propertyNames} is not allowed as input on {$className}";
16
        }
17 3
        parent::__construct($message);
18 3
    }
19
}
20