| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2.004 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 1 | public function run() |
|
| 33 | { |
||
| 34 | 1 | $this->form->getUser()->unconfirmed_email = $this->form->email; |
|
|
|
|||
| 35 | |||
| 36 | 1 | $token = TokenFactory::makeConfirmNewMailToken($this->form->getUser()->id); |
|
| 37 | |||
| 38 | 1 | $mailService = MailFactory::makeReconfirmationMailerService($this->form->getUser(), $token); |
|
| 39 | |||
| 40 | 1 | if ($mailService->run()) { |
|
| 41 | 1 | Yii::$app |
|
| 42 | 1 | ->session |
|
| 43 | 1 | ->setFlash('info', Yii::t('usuario', 'A confirmation message has been sent to your new email address')); |
|
| 44 | |||
| 45 | 1 | 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: