Completed
Push — master ( c83719...6a6753 )
by
unknown
02:45
created

DummySparqlHelper   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 1
dl 0
loc 35
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A hasType() 0 3 1
A findEntitiesWithSameStatement() 0 6 1
A findEntitiesWithSameQualifierOrReference() 0 8 1
A matchesRegularExpression() 0 3 1
A runQuery() 0 3 1
1
<?php
2
3
namespace WikibaseQuality\ConstraintReport\ConstraintCheck\Helper;
4
5
use LogicException;
6
use Wikibase\DataModel\Entity\EntityId;
7
use Wikibase\DataModel\Snak\PropertyValueSnak;
8
use Wikibase\DataModel\Statement\Statement;
9
10
/**
11
 * A fake {@link SparqlHelper} that only serves as a default implementation
12
 * for {@link WikibaseQuality\ConstraintReport\ConstraintsServices ConstraintsServices}.
13
 *
14
 * TODO: SparqlHelper should be refactored so that this isn’t necessary.
15
 * See T196053#4514308 for details.
16
 *
17
 * @license GPL-2.0-or-later
18
 */
19
class DummySparqlHelper extends SparqlHelper {
20
21
	public function __construct() {
22
		// no parent::__construct() call
23
	}
24
25
	public function hasType( $id, array $classes, $withInstance ) {
26
		throw new LogicException( 'methods of this class should never be called' );
27
	}
28
29
	public function findEntitiesWithSameStatement(
30
		Statement $statement,
31
		$ignoreDeprecatedStatements
32
	) {
33
		throw new LogicException( 'methods of this class should never be called' );
34
	}
35
36
	public function findEntitiesWithSameQualifierOrReference(
37
		EntityId $entityId,
38
		PropertyValueSnak $snak,
39
		$type,
40
		$ignoreDeprecatedStatements
41
	) {
42
		throw new LogicException( 'methods of this class should never be called' );
43
	}
44
45
	public function matchesRegularExpression( $text, $regex ) {
46
		throw new LogicException( 'methods of this class should never be called' );
47
	}
48
49
	public function runQuery( $query ) {
50
		throw new LogicException( 'methods of this class should never be called' );
51
	}
52
53
}
54