| Conditions | 2 |
| Paths | 2 |
| Total Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | private static function idPregFormatPart(bool $old): string |
||
| 27 | { |
||
| 28 | if ($old) { |
||
| 29 | [$range1, $range2] = [7, 6]; |
||
| 30 | } else { |
||
| 31 | [$range1, $range2] = [10, 9]; |
||
| 32 | } |
||
| 33 | |||
| 34 | return strtr('((::head1::)\d{::range1::})|((::head2::)\d{::range2::})', [ |
||
| 35 | '::head1::' => implode('|', [ |
||
| 36 | '0[0-8]', |
||
| 37 | '1[0-9]', |
||
| 38 | '2[0-9]', |
||
| 39 | '3[0-8]', |
||
| 40 | ]), |
||
| 41 | '::head2::' => implode('|', [ |
||
| 42 | '09[015]', |
||
| 43 | '23[01]', |
||
| 44 | '245', |
||
| 45 | '28[015]', |
||
| 46 | ]), |
||
| 47 | '::range1::' => $range1, |
||
| 48 | '::range2::' => $range2, |
||
| 49 | ]); |
||
| 50 | } |
||
| 51 | |||
| 70 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.