Completed
Push — master ( d5bce1...bd6130 )
by Klochok
02:22
created

CartTeaser::getModule()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * Cart module for Yii2
5
 *
6
 * @link      https://github.com/hiqdev/yii2-cart
7
 * @package   yii2-cart
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hiqdev\yii2\cart\widgets;
13
14
use hiqdev\yii2\cart\Module;
15
16
class CartTeaser extends \yii\base\Widget
17
{
18
    public function run()
19
    {
20
        return $this->render('CartTeaser', [
21
            'widget' => $this,
22
            'view'   => $this->getView(),
23
            'cart'   => $this->getModule()->getCart(),
24
        ]);
25
    }
26
27
    public function getModule()
28
    {
29
        return Module::getInstance();
30
    }
31
}
32