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.
Completed
Push — dev ( abd4de...e08019 )
by w3l
01:46
created

Convert::rgbhex()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
namespace w3l\Holt45;
3
trait Convert {
4
5
	/**
6
	 * Converts red-green-blue(RGB) to hexadecimal
7
	 *
8
	 * @param array $rgb RGB color
9
	 * @return string Hexadecimal color
10
	 */
11
	function rgbhex($rgb) {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
12
		$hex = "";
13
		foreach($rgb AS $color) {
14
			$hex .= str_pad(dechex($color), 2, "0", STR_PAD_LEFT);
15
		}
16
		return $hex;
17
	}
18
19
}
20