| Total Complexity | 5 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 13 | class UploadAvatarForm extends Widget |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * On/Off widget |
||
| 17 | * @var bool |
||
| 18 | */ |
||
| 19 | public $status = true; |
||
| 20 | /** |
||
| 21 | * @var UploadForm |
||
| 22 | */ |
||
| 23 | public $model; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @inheritDoc |
||
| 27 | */ |
||
| 28 | public function init() |
||
| 29 | { |
||
| 30 | parent::init(); |
||
| 31 | if (($this->status === true) && !($this->model instanceof UploadForm)) { |
||
|
|
|||
| 32 | throw new InvalidArgumentException('The model is not an instance of class: ' . UploadForm::class); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return string|void |
||
| 38 | */ |
||
| 39 | public function run() |
||
| 44 | ]); |
||
| 45 | } |
||
| 48 |