InvalidArgumentException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 40
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getPropertyPath() 0 4 1
A getValue() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace AmmitPhp\Ammit\UI\Resolver\Validator;
5
6
class InvalidArgumentException extends \InvalidArgumentException
7
{
8
    /** @var string|null */
9
    private $propertyPath;
10
11
    /** @var mixed */
12
    private $value;
13
14
    public function __construct($message, int $code = 0, string $propertyPath = null, $value)
15
    {
16
        parent::__construct($message, $code);
17
18
        $this->propertyPath = $propertyPath;
19
        $this->value = $value;
20
    }
21
22
    /**
23
     * User controlled way to define a sub-property causing
24
     * the failure of a currently asserted objects.
25
     *
26
     * Useful to transport information about the nature of the error
27
     * back to higher layers.
28
     *
29
     * @return string|null
30
     */
31
    public function getPropertyPath()
32
    {
33
        return $this->propertyPath;
34
    }
35
36
    /**
37
     * Get the value that caused the assertion to fail.
38
     *
39
     * @return mixed
40
     */
41
    public function getValue()
42
    {
43
        return $this->value;
44
    }
45
}
46