EntityAccessLimitException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getEntityAccessLimit() 0 2 1
A __construct() 0 7 1
A getEntityAccessCount() 0 2 1
1
<?php
2
3
namespace Wikibase\DataModel\Services\Lookup;
4
5
use Wikibase\DataModel\Entity\EntityId;
6
7
/**
8
 * @since 2.1
9
 *
10
 * @license GPL-2.0-or-later
11
 * @author Marius Hoch < [email protected] >
12
 * @author Jeroen De Dauw < [email protected] >
13
 */
14
class EntityAccessLimitException extends EntityLookupException {
15
	private int $entityAccessCount;
16
	private int $entityAccessLimit;
17
18
	public function __construct( EntityId $entityId, int $entityAccessCount, int $entityAccessLimit ) {
19
		parent::__construct(
20
			$entityId,
21
			'Too many entities loaded, must not load more than ' . $entityAccessLimit . ' entities.'
22
		);
23
		$this->entityAccessCount = $entityAccessCount;
24
		$this->entityAccessLimit = $entityAccessLimit;
25
	}
26
27
	public function getEntityAccessCount(): int {
28
		return $this->entityAccessCount;
29
	}
30
31
	public function getEntityAccessLimit(): int {
32
		return $this->entityAccessLimit;
33
	}
34
}
35