Passed
Push — master ( 460ec1...4bf46c )
by Gabriel
07:02
created

FeeCalculator::netToGross()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 3
dl 0
loc 4
rs 10
1
<?php
2
3
namespace ByTIC\Payments\Utility;
4
5
/**
6
 * Class FeeCalculator
7
 * @package ByTIC\Payments\Utility
8
 */
9
class FeeCalculator
10
{
11
    /**
12
     * @param $amount
13
     * @param $percentage
14
     * @param $fixed
15
     */
16
    public static function netToGross($amount, $percentage, $fixed = 0)
17
    {
18
        $result = ($amount + $fixed) / (1 - $percentage / 100);
19
        return ceil($result);
20
    }
21
}