| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 16 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 19 | 5 | public function __construct($variableName, $variableValue, $length) |
|
| 20 | { |
||
| 21 | 5 | if (!is_string($variableName)) { |
|
| 22 | 1 | throw new InvalidStringException('variableName', $variableName); |
|
| 23 | 4 | } elseif (!is_string($variableValue)) { |
|
| 24 | 1 | throw new InvalidStringException('variableValue', $variableValue); |
|
| 25 | 4 | } elseif (!is_int($length)) { |
|
| 26 | 1 | throw new InvalidIntException('length', $length); |
|
| 27 | } |
||
| 28 | |||
| 29 | 4 | parent::__construct( |
|
| 30 | 4 | sprintf( |
|
| 31 | 4 | 'Variable "$%s" must have length less than "%d", actual length: "%d"', |
|
| 32 | 4 | $variableName, |
|
| 33 | 4 | $length, |
|
| 34 | 4 | mb_strlen($variableValue) |
|
| 35 | 4 | ) |
|
| 36 | 4 | ); |
|
| 37 | } |
||
| 38 | } |