File::getUrl()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Mediawiki\DataModel;
4
5
use InvalidArgumentException;
6
7
/**
8
 * @author Addshore
9
 */
10
class File extends Page {
11
12
	/**
13
	 * @var string
14
	 */
15
	private $url;
16
17
	/**
18
	 * @param string $url
19
	 * @param PageIdentifier|null $pageIdentifier
20
	 * @param Revisions|null $revisions
21
	 */
22 1
	public function __construct( $url, PageIdentifier $pageIdentifier = null, Revisions $revisions = null ) {
23 1
		parent::__construct( $pageIdentifier, $revisions );
24 1
		if ( !is_string( $url ) ) {
25
			throw new InvalidArgumentException( '$url must be a string' );
26
		}
27 1
		$this->url = $url;
28 1
	}
29
30
	/**
31
	 * @return string
32
	 */
33 1
	public function getUrl() {
34 1
		return $this->url;
35
	}
36
37
}
38