MapsFileFetcher   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 80%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A fetchFile() 0 9 2
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace Maps\DataAccess;
6
7
use FileFetcher\FileFetcher;
8
use FileFetcher\FileFetchingException;
9
10
/**
11
 * @licence GNU GPL v2+
12
 * @author Jeroen De Dauw < [email protected] >
13
 */
14
class MapsFileFetcher implements FileFetcher {
15
16 2
	public function fetchFile( string $fileUrl ): string {
17 2
		$result = \Http::get( $fileUrl );
18
19 2
		if ( !is_string( $result ) ) {
20
			throw new FileFetchingException( $fileUrl );
21
		}
22
23 2
		return $result;
24
	}
25
26
}
27