| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | |||
| 46 | list($localPart) = explode('@', $email); |
||
| 47 | |||
| 48 | while (in_array($localPart.'@'.$this->domain, $this->dictionary)) { |
||
| 49 | $localPart = $this->increment($localPart); |
||
| 50 | } |
||
| 51 | |||
| 52 | $this->dictionary[$email] = $localPart.'@'.$this->domain; |
||
| 53 | } |
||
| 54 | |||
| 55 | private function increment(string $string): string |
||
| 56 | { |
||
| 57 | $pattern = '/-(\d+$)/'; |
||
| 58 | $matches = []; |
||
| 59 | |||
| 67 |