MediaWikiFileFetcher   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A fetchFile() 0 9 2
1
<?php
2
3
namespace GitHub;
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 MediaWikiFileFetcher 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