Completed
Push — master ( 9ed145...8e4a93 )
by vistart
04:04
created

MemberListWidget   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 6 2
A run() 0 7 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
14
namespace rhosocial\organization\widgets;
15
16
use Yii;
17
use yii\base\Widget;
18
use yii\data\ActiveDataProvider;
19
use yii\web\ServerErrorHttpException;
20
21
/**
22
 * Class MemberListWidget
23
 * @package rhosocial\organization\widgets
24
 * @version 1.0
25
 * @author vistart <[email protected]>
26
 */
27
class MemberListWidget extends Widget
28
{
29
    /**
30
     * @var ActiveDataProvider
31
     */
32
    public $dataProvider;
33
    public $tips = true;
34
35
    public function init()
36
    {
37
        if (empty($this->dataProvider)) {
38
            throw new ServerErrorHttpException('Invalid Member Provider.');
39
        }
40
    }
41
42
    public function run()
43
    {
44
        return $this->render('member-list', [
45
            'dataProvider' => $this->dataProvider,
46
            'tips' => $this->tips,
47
        ]);
48
    }
49
}
50