MediaFlagVideoSource   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 10
c 3
b 0
f 0
dl 0
loc 15
rs 10
wmc 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A getIcon() 0 12 5
1
<?php
2
3
/**
4
 * Video source flag
5
 *
6
 * @author Stefan Spühler <[email protected]>
7
 * @copyright Copyright &copy; Stefan Spühler 2013-
8
 * @license https://www.gnu.org/licenses/gpl.html The GNU General Public License v3.0
9
 */
10
11
class MediaFlagVideoSource extends MediaFlag
12
{
13
14
	protected function getIcon()
15
	{
16
		if (preg_match('/\.TS\.|\.TELESYNC\./i', $this->file))
17
			return 'TS';
18
		else if (preg_match('/\.CAM\./i', $this->file))
19
			return 'CAM';
20
		else if (preg_match('/\.DVDSCR\.|\.SCREENER\./i', $this->file))
21
			return 'TS';
22
		else if (preg_match('/\.WEBRip\./i', $this->file))
23
			return 'WEBRIP';
24
25
		return false;
26
	}
27
28
}
29