Completed
Push — master ( 9da703...f01de4 )
by Dmitry
05:44 queued 03:43
created

Discount   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fixed() 0 4 1
A grows() 0 4 1
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
/**
14
 * General discount.
15
 *
16
 * @author Andrii Vasyliev <[email protected]>
17
 */
18
class Discount extends Modifier
19
{
20 2
    public function fixed($value)
21
    {
22 2
        return new FixedDiscount($value, $this->addons);
23
    }
24
25 1
    public function grows($step, $min = null)
26
    {
27 1
        return new GrowingDiscount($step, $min, $this->addons);
28
    }
29
}
30