UnknownForeignRepositoryException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
A getRepositoryName() 0 3 1
1
<?php
2
3
namespace Wikibase\DataModel\Services\Lookup;
4
5
use Exception;
6
use InvalidArgumentException;
7
8
/**
9
 * @since 3.7
10
 *
11
 * @license GPL-2.0-or-later
12
 */
13
class UnknownForeignRepositoryException extends InvalidArgumentException {
14
15
	/**
16
	 * @var string
17
	 */
18
	private $repositoryName;
19
20
	/**
21
	 * @param string $repositoryName
22
	 * @param string|null $message
23
	 * @param Exception|null $previous
24
	 */
25
	public function __construct( $repositoryName, $message = null, Exception $previous = null ) {
26
		$this->repositoryName = $repositoryName;
27
28
		parent::__construct(
29
			$message ?: 'Unknown repository name: ' . $repositoryName,
30
			0,
31
			$previous
32
		);
33
	}
34
35
	/**
36
	 * @return string
37
	 */
38
	public function getRepositoryName() {
39
		return $this->repositoryName;
40
	}
41
42
}
43