Completed
Push — leaflet-attribution ( 0121c0 )
by Peter
04:35
created

MapsFileFetcher   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 13
rs 10

1 Method

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