Conditions | 4 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
19 | 3 | public function __construct($variableName, $variableValue) |
|
20 | { |
||
21 | 3 | if (!is_string($variableName)) { |
|
22 | 1 | throw new InvalidStringException('variableName', $variableName); |
|
23 | 2 | } elseif (is_null($variableValue) || is_int($variableValue)) { |
|
24 | 1 | throw new InvalidNotNullAndNotIntException($variableName); |
|
25 | } |
||
26 | |||
27 | 2 | parent::__construct( |
|
28 | 2 | sprintf( |
|
29 | 2 | 'Variable "$%s" must be: "null" or "int", actual type: "%s"', |
|
30 | 2 | $variableName, |
|
31 | 2 | gettype($variableValue) |
|
32 | 2 | ) |
|
33 | 2 | ); |
|
34 | 2 | } |
|
35 | } |
||
36 |