Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
28 | 2 | public function __construct( |
|
29 | $attributeName, |
||
30 | $attributeValue, |
||
31 | $message = '', |
||
32 | Exception $previous = null |
||
33 | ) { |
||
34 | 2 | $this->attributeName = $attributeName; |
|
35 | 2 | $this->attributeValue = $attributeValue; |
|
36 | |||
37 | 2 | if ( $message === '' ) { |
|
38 | 1 | $message = 'Attribute "' . $attributeName . '"'; |
|
39 | |||
40 | 1 | if ( is_scalar( $attributeValue ) ) { |
|
41 | 1 | $message .= ' with value "' . $attributeValue . '"'; |
|
42 | } |
||
43 | |||
44 | 1 | $message .= ' is invalid'; |
|
45 | } |
||
46 | |||
47 | 2 | parent::__construct( $message, $previous ); |
|
48 | 2 | } |
|
49 | |||
65 |