Completed
Push — main ( 1f6f71...689fbc )
by
unknown
04:30
created

File::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 3
1
<?php
2
3
namespace Addwiki\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
	public function __construct( $url, PageIdentifier $pageIdentifier = null, Revisions $revisions = null ) {
23
		parent::__construct( $pageIdentifier, $revisions );
24
		if ( !is_string( $url ) ) {
25
			throw new InvalidArgumentException( '$url must be a string' );
26
		}
27
		$this->url = $url;
28
	}
29
30
	/**
31
	 * @return string
32
	 */
33
	public function getUrl() {
34
		return $this->url;
35
	}
36
37
}
38