Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Lines | 3 |
Ratio | 30 % |
Changes | 0 |
1 | <?php |
||
22 | public function endOfLoopValidations(EmailLexer $lexer) : Result |
||
23 | { |
||
24 | //test for end of string |
||
25 | View Code Duplication | if (!$lexer->isNextToken(EmailLexer::S_DOT)) { |
|
|
|||
26 | return new InvalidEmail(new ExpectingATEXT('DOT not found near CLOSEPARENTHESIS'), $lexer->token['value']); |
||
27 | } |
||
28 | //add warning |
||
29 | //Address is valid within the message but cannot be used unmodified for the envelope |
||
30 | return new ValidEmail(); |
||
31 | } |
||
32 | |||
37 | } |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.