GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Temperature   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 46
c 0
b 0
f 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A convertor() 0 3 1
A kToF() 0 3 1
A fToK() 0 3 1
A kToC() 0 3 1
A cToK() 0 3 1
1
<?php
2
3
namespace rdx\units;
4
5
use rdx\units\Quantity;
6
7
class Temperature extends Quantity {
8
9
	// The base unit for the `$units` conversion table
10
	const BASE_UNIT = 'k'; // Kelvin
11
12
	// New objects will convert to this unit
13
	static public $default_unit = self::BASE_UNIT;
14
15
	static public $units = array('k', 'c', 'f');
16
17
	/**
18
	 *
19
	 */
20
	protected function convertor( $toUnit ) {
21
		return $this->convertUsingMethods($toUnit);
22
	}
23
24
	/**
25
	 *
26
	 */
27
	protected function kToF( $amount ) {
28
		return ($amount - 273.15) * 9/5 + 32;
29
	}
30
31
	/**
32
	 *
33
	 */
34
	protected function fToK( $amount ) {
35
		return ($amount - 32) * 5/9 + 273.15;
36
	}
37
38
	/**
39
	 *
40
	 */
41
	protected function kToC( $amount ) {
42
		return $amount - 273.15;
43
	}
44
45
	/**
46
	 *
47
	 */
48
	protected function cToK( $amount ) {
49
		return $amount + 273.15;
50
	}
51
52
}
53