Passed
Pull Request — master (#274)
by Sergei
03:21
created

UndefinedPropertyException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A forUndefinedProperty() 0 3 1
A forNotNestedProperty() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Form;
6
7
use InvalidArgumentException;
8
9
final class UndefinedPropertyException extends InvalidArgumentException
10
{
11 7
    private function __construct(string $message)
12
    {
13 7
        parent::__construct($message);
14
    }
15
16 6
    public static function forUndefinedProperty(string $property): self
17
    {
18 6
        return new self('Undefined property: "' . $property . '".');
19
    }
20
21 1
    public static function forNotNestedProperty(string $property): self
22
    {
23 1
        return new self('Property "' . $property . '" is not a nested attribute.');
24
    }
25
}
26