Completed
Push — master ( c4e316...a2ecb8 )
by vistart
02:57
created

ChangePasswordFormWidget::init()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 3
eloc 3
nc 2
nop 0
1
<?php
2
3
/**
4
 *  _   __ __ _____ _____ ___  ____  _____
5
 * | | / // // ___//_  _//   ||  __||_   _|
6
 * | |/ // /(__  )  / / / /| || |     | |
7
 * |___//_//____/  /_/ /_/ |_||_|     |_|
8
 * @link https://vistart.me/
9
 * @copyright Copyright (c) 2016 - 2017 vistart
10
 * @license https://vistart.me/license/
11
 */
12
13
namespace rhosocial\user\widgets;
14
15
use rhosocial\user\forms\ChangePasswordForm;
16
use yii\base\Widget;
17
18
class ChangePasswordFormWidget extends Widget
19
{
20
    /**
21
     * @var ChangePasswordFOrm
22
     */
23
    public $model;
24
    
25
    public function init()
26
    {
27
        if (is_null($this->model) || !($this->model instanceof ChangePasswordForm)) {
28
            $this->model = new ChangePasswordForm();
0 ignored issues
show
Documentation Bug introduced by
It seems like new \rhosocial\user\forms\ChangePasswordForm() of type object<rhosocial\user\forms\ChangePasswordForm> is incompatible with the declared type object<rhosocial\user\widgets\ChangePasswordFOrm> of property $model.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
29
        }
30
    }
31
    
32
    public function run()
33
    {
34
        return $this->render('change-password-form-widget', ['model' => $this->model]);
35
    }
36
}
37