BankValidator::init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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