We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 4.0466 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | 17 | public function validate($input) |
|
| 35 | { |
||
| 36 | 17 | $emailValidator = $this->getEmailValidator(); |
|
| 37 | 17 | if (!$emailValidator instanceof EmailValidator) { |
|
| 38 | 16 | return is_string($input) && filter_var($input, FILTER_VALIDATE_EMAIL); |
|
| 39 | } |
||
| 40 | |||
| 41 | 1 | if (!class_exists('Egulias\\EmailValidator\\Validation\\RFCValidation')) { |
|
| 42 | 1 | return $emailValidator->isValid($input); |
|
| 43 | } |
||
| 44 | |||
| 45 | return $emailValidator->isValid($input, new RFCValidation()); |
||
| 46 | } |
||
| 47 | } |
||
| 48 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: