FileFetchingException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
nc 1
nop 3
dl 0
loc 9
ccs 6
cts 6
cp 1
crap 2
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace FileFetcher;
6
7
/**
8
 * @since 3.0
9
 *
10
 * @licence BSD-3-Clause
11
 * @author Jeroen De Dauw < [email protected] >
12
 */
13
class FileFetchingException extends \RuntimeException {
14
15
	private $fileUrl;
16
17 4
	public function __construct( string $fileUrl, string $message = null, \Exception $previous = null ) {
18 4
		$this->fileUrl = $fileUrl;
19
20 4
		parent::__construct(
21 4
			$message ?: 'Could not fetch file: ' . $fileUrl,
22 4
			0,
23
			$previous
24
		);
25 4
	}
26
27 1
	public function getFileUrl(): string {
28 1
		return $this->fileUrl;
29
	}
30
31
}
32