GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Calculation   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 38
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A sum() 0 4 1
A subtract() 0 4 1
A comparator() 0 4 1
1
<?php
2
3
namespace WSW\Money\Support;
4
5
/**
6
 * Trait Calculation
7
 *
8
 * @package WSW\Money\Support
9
 * @author Ronaldo Matos Rodrigues <[email protected]>
10
 */
11
trait Calculation
12
{
13
    /**
14
     * @param string|float|int $amount
15
     * @param string|float|int $addend
16
     * @param int $decimals
17
     *
18
     * @return string
19
     */
20 2
    protected function sum($amount, $addend, $decimals)
21
    {
22 2
        return bcadd($amount, $addend, $decimals);
23
    }
24
25
    /**
26
     * @param string|float|int $amount
27
     * @param string|float|int $subtrahend
28
     * @param int $decimals
29
     *
30
     * @return string
31
     */
32 2
    protected function subtract($amount, $subtrahend, $decimals)
33
    {
34 2
        return bcsub($amount, $subtrahend, $decimals);
35
    }
36
37
    /**
38
     * @param string|float|int $amount
39
     * @param string|float|int $other
40
     * @param int $decimals
41
     *
42
     * @return int
43
     */
44 1
    protected function comparator($amount, $other, $decimals)
45
    {
46 1
        return (int) bccomp($amount, $other, $decimals);
47
    }
48
}
49