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

PayButtonCommentBehavior::events()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 0
cts 0
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
crap 2
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