Completed
Push — master ( 20e866...0b2f89 )
by Dmitry
04:38
created

PayButtonCommentBehavior   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 14
ccs 0
cts 4
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A events() 0 6 1
A handleCommentBehavior() 0 4 1
1
<?php
2
3
namespace hipanel\modules\finance\behaviors;
4
5
use hipanel\modules\finance\widgets\PayButtonComment;
6
use hiqdev\yii2\merchant\widgets\PayButton;
7
use Yii;
8
use yii\base\Behavior;
9
10
class PayButtonCommentBehavior extends Behavior
11
{
12
    public function events()
13
    {
14
        return [
15
            PayButton::EVENT_RENDER_COMMENT => 'handleCommentBehavior'
16
        ];
17
    }
18
19
    public function handleCommentBehavior($event)
20
    {
21
        echo Yii::createObject(PayButtonComment::class, [$event])->run();
22
    }
23
}
24