Txt   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 22
ccs 11
cts 11
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B getLinks() 0 18 5
1
<?php
2
namespace Tartana\Component\Decrypter;
3
4
use Tartana\Util;
5
6
class Txt extends BaseDecrypter
7
{
8
9 4
	public function getLinks($content)
10
	{
11 4
		$mustUnset = false;
12 4
		$links     = explode(PHP_EOL, $content);
13 4
		foreach ($links as $key => $link) {
14 4
			$uri = Util::parseUrl($link);
15 4
			if (!$uri['scheme']) {
16 2
				unset($links[$key]);
17 4
				$mustUnset = true;
18
			}
19
		}
20
21 4
		if ($mustUnset && empty($links)) {
22 2
			throw new \RuntimeException('Invalid content');
23
		}
24
25 2
		return $links;
26
	}
27
}
28