summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Maps/src/DataAccess/MapsFileFetcher.php
blob: 79d7f07fba8fac0fc294e13719d5402477e087d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

declare( strict_types = 1 );

namespace Maps\DataAccess;

use FileFetcher\FileFetcher;
use FileFetcher\FileFetchingException;

/**
 * @licence GNU GPL v2+
 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
 */
class MapsFileFetcher implements FileFetcher {

	public function fetchFile( string $fileUrl ): string {
		$result = \Http::get( $fileUrl );

		if ( !is_string( $result ) ) {
			throw new FileFetchingException( $fileUrl );
		}

		return $result;
	}

}