Passed
Push — 4.x ( bd875a...fa991c )
by Doug
17:17 queued 12:22
created

Unity::getValue()   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
eloc 1
dl 0
loc 3
c 1
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * PHPCoord.
4
 *
5
 * @author Doug Wright
6
 */
7
declare(strict_types=1);
8
9
namespace PHPCoord\UnitOfMeasure\Scale;
10
11
class Unity implements Scale
12
{
13
    /** @var float */
14
    private $scale;
15
16 7
    public function __construct(float $scale)
17
    {
18 7
        $this->scale = $scale;
19 7
    }
20
21 1
    public function asUnity(): self
22
    {
23 1
        return $this;
24
    }
25
26 3
    public function getValue(): float
27
    {
28 3
        return $this->scale;
29
    }
30
31 1
    public function getFormattedValue(): string
32
    {
33 1
        return (string) $this->scale;
34
    }
35
36 1
    public function getUnitName(): string
37
    {
38 1
        return '';
39
    }
40
41
    public function __toString(): string
42
    {
43
        return (string) $this->getValue();
44
    }
45
}
46