Celsius   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 26
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A toCelsius() 0 4 1
A toKelvin() 0 4 1
A toFahrenheit() 0 4 1
1
<?php
2
3
namespace ValueObjects\Climate;
4
5
class Celsius extends Temperature
6
{
7
    /**
8
     * @return Celsius
9
     */
10 1
    public function toCelsius()
11
    {
12 1
        return new static($this->value);
13
    }
14
15
    /**
16
     * @return Kelvin
17
     */
18 1
    public function toKelvin()
19
    {
20 1
        return new Kelvin($this->value + 273.15);
21
    }
22
23
    /**
24
     * @return Fahrenheit
25
     */
26 1
    public function toFahrenheit()
27
    {
28 1
        return new Fahrenheit($this->value * 1.8 + 32);
29
    }
30
}
31