BankValidator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 6 1
1
<?php
2
/**
3
 * @link https://github.com/yiiviet/yii2-payment
4
 * @copyright Copyright (c) 2017 Yii Viet
5
 * @license [New BSD License](http://www.opensource.org/licenses/bsd-license.php)
6
 */
7
8
namespace yiiviet\payment;
9
10
use yii\validators\RangeValidator;
11
12
/**
13
 * Lớp BankValidator hổ trợ kiểm tra tính hợp lệ của mã ngân hàng gửi lên từ client side.
14
 *
15
 * @author Vuong Minh <[email protected]>
16
 * @since 1.0.3
17
 */
18
class BankValidator extends RangeValidator
19
{
20
21
    use GatewayBankProviderTrait;
22
23
    /**
24
     * @inheritdoc
25
     */
26 3
    public function init()
27
    {
28 3
        $this->range = array_keys($this->provider->banks());
29
30 2
        parent::init();
31 2
    }
32
}
33