| Conditions | 3 |
| Paths | 2 |
| Total Lines | 7 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | 132 | protected function checkConsecutiveDots() : Result |
|
| 47 | { |
||
| 48 | 132 | if ($this->lexer->token['type'] === EmailLexer::S_DOT && $this->lexer->isNextToken(EmailLexer::S_DOT)) { |
|
| 49 | 2 | return new InvalidEmail(new ConsecutiveDot(), $this->lexer->token['value']); |
|
| 50 | } |
||
| 51 | |||
| 52 | 132 | return new ValidEmail(); |
|
| 53 | } |
||
| 63 | } |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.