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