Completed
Push — master ( 60539d...725f3a )
by Dmitry
07:23
created

DepositForm   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 40
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 8 1
A attributes() 0 4 1
A attributeLabels() 0 6 1
1
<?php
2
/**
3
 * Yii2 extension for payment processing with Omnipay, Payum and more later.
4
 *
5
 * @link      https://github.com/hiqdev/yii2-merchant
6
 * @package   yii2-merchant
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\yii2\merchant\models;
12
13
use Yii;
14
use yii\base\Model;
15
16
/**
17
 * Class Deposit.
18
 */
19
class DepositForm extends Model
20
{
21
    /**
22
     * @var float the amount of money
23
     */
24
    public $amount;
25
26
    /**
27
     * @var string the route that will be passed to merchant
28
     * in order to redirect user to a custom page
29
     */
30
    public $finishUrl;
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function rules()
36
    {
37
        return [
38
            [['amount'], 'number'],
39
            [['amount'], 'required'],
40
            [['amount'], 'compare', 'operator' => '>', 'compareValue' => 0],
41
        ];
42
    }
43
44
    public function attributes()
45
    {
46
        return ['amount'];
47
    }
48
49
    /**
50
     * {@inheritdoc}
51
     */
52
    public function attributeLabels()
53
    {
54
        return [
55
            'amount' => Yii::t('merchant', 'Amount'),
56
        ];
57
    }
58
}
59