| 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 | 5 | public function __construct($variableName, $variableValue) |
|
| 20 | { |
||
| 21 | 5 | if (!is_string($variableName)) { |
|
| 22 | 1 | throw new InvalidStringException('variableName', $variableName); |
|
| 23 | 4 | } elseif (is_int($variableValue) || is_string($variableValue)) { |
|
| 24 | 1 | throw new InvalidNotIntAndNotStringException($variableName); |
|
| 25 | } |
||
| 26 | |||
| 27 | 4 | parent::__construct( |
|
| 28 | 4 | sprintf( |
|
| 29 | 4 | 'Variable "$%s" must be: "int" or "string", actual type: "%s"', |
|
| 30 | 4 | $variableName, |
|
| 31 | 4 | gettype($variableValue) |
|
| 32 | 4 | ) |
|
| 33 | 4 | ); |
|
| 34 | 4 | } |
|
| 35 | } |
||
| 36 |