| Conditions | 2 |
| Paths | 1 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 54 | 1 | public function rules() |
|
| 55 | { |
||
| 56 | return [ |
||
| 57 | 1 | 'requiredFields' => [['password'], 'required'], |
|
| 58 | 'passwordValidate' => [ |
||
| 59 | 1 | 'password', |
|
| 60 | function ($attribute) { |
||
| 61 | 1 | if (!$this->securityHelper |
|
| 62 | 1 | ->validatePassword($this->password, $this->getUser()->password_hash) |
|
|
|
|||
| 63 | ) { |
||
| 64 | 1 | $this->addError($attribute, Yii::t('usuario', 'Invalid password')); |
|
| 65 | } |
||
| 66 | 1 | }, |
|
| 67 | ] |
||
| 68 | ]; |
||
| 69 | } |
||
| 70 | |||
| 90 |
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: