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

CourseHandicap::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 5
ccs 2
cts 2
cp 1
rs 9.4285
cc 1
eloc 2
nc 1
nop 2
crap 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
}