Calculator   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
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 18
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A sum() 0 8 3
1
<?php
2
/**
3
 * Class Calculator
4
 *
5
 * @package Mwesterink\ServiceChecks\Classes
6
 * @author  Michel Westerink <[email protected]>
7
 */
8
9
namespace Mwesterink\ServiceChecks\Classes;
10
11
class Calculator
12
{
13
    /**
14
     * @param int $firstDigit
15
     * @param int $secondDigit
16
     *
17
     * @return int
18
     * @throws \Exception
19
     */
20 2
    public function sum($firstDigit, $secondDigit)
21
    {
22 2
        if (!is_numeric($firstDigit) || !is_numeric($secondDigit)) {
23 1
            throw new \Exception('One of the digits is not numeric');
24
        }
25
26 1
        return $firstDigit + $secondDigit;
27
    }
28
}
29