Passed
Push — master ( 2b8bad...6fb66b )
by Doug
25:16
created

MicroRadian::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
/**
3
 * PHPCoord.
4
 *
5
 * @author Doug Wright
6
 */
7
declare(strict_types=1);
8
9
namespace PHPCoord\UnitOfMeasure\Angle;
10
11
class MicroRadian extends Angle
12
{
13
    private float $angle;
14
15 63
    public function __construct(float $angle)
16
    {
17 63
        $this->angle = $angle;
18
    }
19
20 45
    public function asRadians(): Radian
21
    {
22 45
        return new Radian($this->angle / 1000000);
23
    }
24
25
    public function getValue(): float
26
    {
27
        return $this->angle;
28
    }
29
30 9
    public function getUnitName(): string
31
    {
32 9
        return 'microradian';
33
    }
34
}
35