| Conditions | 4 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | private function determineMaxValue(array $mapping) |
||
| 33 | { |
||
| 34 | $defaultMax = 2000000000; |
||
| 35 | |||
| 36 | $lengthUndefined = !isset($mapping['length']); |
||
| 37 | if ($lengthUndefined) { |
||
| 38 | return $defaultMax; |
||
| 39 | } |
||
| 40 | |||
| 41 | $lengthInvalid = $mapping['length'] < 1 |
||
| 42 | || $mapping['length'] >= strlen($defaultMax); |
||
| 43 | if ($lengthInvalid) { |
||
| 44 | return $defaultMax; |
||
| 45 | } |
||
| 46 | |||
| 47 | $maxValue = (int)str_repeat('9', $mapping['length']); |
||
| 48 | |||
| 49 | return $maxValue; |
||
| 50 | } |
||
| 51 | |||
| 57 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@returnannotation as described here.