Passed
Push — extents ( 6d8774...01b6e3 )
by Doug
61:12
created

MicroRadian   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 22
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
A __construct() 0 3 1
A getUnitName() 0 3 1
A asRadians() 0 3 1
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
    public function __construct(float $angle)
16
    {
17
        $this->angle = $angle;
18
    }
19
20
    public function asRadians(): Radian
21
    {
22
        return new Radian($this->angle / 1000000);
23
    }
24
25
    public function getValue(): float
26
    {
27
        return $this->angle;
28
    }
29
30
    public function getUnitName(): string
31
    {
32
        return 'microradian';
33
    }
34
}
35