| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function validate(string $localPart): bool |
||
| 22 | { |
||
| 23 | // Empty local part is invalid |
||
| 24 | if ($localPart === '') { |
||
| 25 | return false; |
||
| 26 | } |
||
| 27 | |||
| 28 | // Split into atoms |
||
| 29 | $atoms = explode('.', $localPart); |
||
| 30 | |||
| 31 | // Check each atom |
||
| 32 | foreach ($atoms as $atom) { |
||
| 33 | if (!$this->validateAtom($atom)) { |
||
| 34 | return false; |
||
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | return true; |
||
| 39 | } |
||
| 56 | } |