Completed
Push — master ( 9eb8f3...27c704 )
by vistart
05:33
created

MemberFormWidget   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 6 2
A run() 0 4 1
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\organization\widgets;
14
15
use rhosocial\organization\Member;
16
use yii\base\Widget;
17
use yii\web\ServerErrorHttpException;
18
19
/**
20
 * Class MemberFormWidget
21
 * @package rhosocial\organization\widgets
22
 * @version 1.0
23
 * @author vistart <[email protected]>
24
 */
25
class MemberFormWidget extends Widget
26
{
27
    /**
28
     * @var Member
29
     */
30
    public $member;
31
    public function init()
32
    {
33
        if (!$this->member) {
34
            throw new ServerErrorHttpException('Invalid Member Model.');
35
        }
36
    }
37
38
    /**
39
     * @return string rendering results.
40
     */
41
    public function run()
42
    {
43
        return $this->render('member-form', ['model' => $this->member]);
44
    }
45
}
46