Completed
Push — master ( 2eb122...6a0424 )
by Andrii
02:35
created

Discount::grows()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 0
cp 0
cc 1
eloc 2
nc 1
nop 2
crap 2
1
<?php
2
/**
3
 * PHP Billing Library
4
 *
5
 * @link      https://github.com/hiqdev/php-billing
6
 * @package   php-billing
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\php\billing\charge\modifiers;
12
13
use Money\Currency;
14
use Money\Money;
15
16
/**
17
 * General discount.
18
 *
19
 * @author Andrii Vasyliev <[email protected]>
20 2
 */
21
class Discount extends Modifier
22 2
{
23
    public function fixed($value)
24
    {
25 1
        return new FixedDiscount($value, $this->addons);
26
    }
27 1
28
    public function grows($step, $min = null)
29
    {
30
        return new GrowingDiscount($step, $min, $this->addons);
31
    }
32
}
33