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 Imedia\Ammit\UI\Resolver\Validator;
5
6
/**
7
 * @author Guillaume MOREL <[email protected]>
8
 */
9
class InvalidArgumentException extends \InvalidArgumentException
10
{
11
    /** @var string|null */
12
    private $propertyPath;
13
14
    /** @var mixed */
15
    private $value;
16
17
    public function __construct($message, int $code = 0, string $propertyPath = null, $value)
18
    {
19
        parent::__construct($message, $code);
20
21
        $this->propertyPath = $propertyPath;
22
        $this->value = $value;
23
    }
24
25
    /**
26
     * User controlled way to define a sub-property causing
27
     * the failure of a currently asserted objects.
28
     *
29
     * Useful to transport information about the nature of the error
30
     * back to higher layers.
31
     *
32
     * @return string|null
33
     */
34
    public function getPropertyPath()
35
    {
36
        return $this->propertyPath;
37
    }
38
39
    /**
40
     * Get the value that caused the assertion to fail.
41
     *
42
     * @return mixed
43
     */
44
    public function getValue()
45
    {
46
        return $this->value;
47
    }
48
}
49