File   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 87.5%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 28
ccs 7
cts 8
cp 0.875
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
A getUrl() 0 3 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