Completed
Pull Request — master (#3)
by Dmitry
30:18 queued 26:17
created

DepositForm::attributeLabels()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
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
     * {@inheritdoc}
28
     */
29
    public function rules()
30
    {
31
        return [
32
            [['amount'], 'number'],
33
            [['amount'], 'required'],
34
            [['amount'], 'compare', 'operator' => '>', 'compareValue' => 0],
35
        ];
36
    }
37
38
    public function attributes()
39
    {
40
        return ['amount'];
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function attributeLabels()
47
    {
48
        return [
49
            'amount' => Yii::t('merchant', 'Amount'),
50
        ];
51
    }
52
}
53