Passed
Push — master ( d021a5...a13070 )
by Sam
03:47 queued 12s
created

MediaFlagResolution   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
eloc 12
c 2
b 0
f 2
dl 0
loc 17
rs 10
wmc 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A getIcon() 0 14 5
1
<?php
2
3
/**
4
 * Video resolution flag
5
 *
6
 * @author Sam Stenvall <[email protected]>
7
 * @copyright Copyright &copy; Sam Stenvall 2013-
8
 * @license https://www.gnu.org/licenses/gpl.html The GNU General Public License v3.0
9
 */
10
class MediaFlagResolution extends MediaFlagStreamDetails
11
{
12
13
	protected function getIcon()
14
	{
15
		$width = $this->video->width;
16
17
		if ($width == 0)
18
			return false;
19
		elseif ($width < 961)
20
			return '50px-480';
21
		elseif ($width < 1281)
22
			return '50px-720';
23
		else if ($width < 3500) // highly unscientific
24
			return '50px-1080_n';
25
		else
26
			return '4K';
27
	}
28
29
}