| Conditions | 5 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 47 | public static function getStringLengthsFromNumber(int $number, bool $exclusive = false): array |
||
| 48 | { |
||
| 49 | if ($number === 1) { |
||
| 50 | return [1.0]; |
||
| 51 | } |
||
| 52 | |||
| 53 | $harmonics = []; |
||
| 54 | for ($numerator = 1; $numerator < $number; $numerator++) { |
||
| 55 | if (!$exclusive || (int) Math::gcd($numerator, $number) === 1) { |
||
| 56 | $harmonics[] = $numerator / $number; |
||
| 57 | } |
||
| 58 | } |
||
| 59 | |||
| 60 | return $harmonics; |
||
| 61 | } |
||
| 62 | |||
| 79 |