Completed
Push — master ( 236403...70f3fa )
by Michael
02:53
created

CourseHandicap   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 5 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: mschmidt
5
 * Date: 8/24/2016
6
 * Time: 3:11 PM
7
 */
8
9
namespace GLsoftware\Golf;
10
11
12
class CourseHandicap
13
{
14
    const SLOPE = 113;
15
16
    /**
17
     * @param $handicap
18
     * @param $courseSlope
19
     * @return float
20
     */
21 1
    public function get($handicap, $courseSlope)
22
    {
23
        // course handicaps are rounded to the nearest whole number
24 1
        return round((($handicap * $courseSlope) / self::SLOPE),0);
25
    }
26
}