| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function run() |
||
| 33 | { |
||
| 34 | $this->form->getUser()->unconfirmed_email = $this->form->email; |
||
|
|
|||
| 35 | |||
| 36 | $token = TokenFactory::makeConfirmNewMailToken($this->form->getUser()->id); |
||
| 37 | |||
| 38 | $mailService = MailFactory::makeReconfirmationMailerService($this->form->getUser(), $token); |
||
| 39 | |||
| 40 | if ($mailService->run()) { |
||
| 41 | Yii::$app |
||
| 42 | ->session |
||
| 43 | ->setFlash('info', Yii::t('usuario', 'A confirmation message has been sent to your new email address')); |
||
| 44 | |||
| 45 | return $this->form->getUser()->save(); |
||
| 46 | } |
||
| 47 | |||
| 48 | return false; |
||
| 49 | } |
||
| 50 | } |
||
| 51 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: