Completed
Push — master ( 17dff3...f2d821 )
by mw
42:32 queued 07:38
created

ThingDescription::getFingerprint()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
ccs 2
cts 2
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace SMW\Query\Language;
4
5
/**
6
 * A dummy description that describes any object. Corresponds to
7
 * owl:thing, the class of all abstract objects. Note that it is
8
 * not used for datavalues of attributes in order to support type
9
 * hinting in the API: descriptions of data are always
10
 * ValueDescription objects.
11
 *
12
 * @license GNU GPL v2+
13
 * @since 1.6
14
 *
15
 * @author Markus Krötzsch
16
 */
17
class ThingDescription extends Description {
18
19 42
	public function getQueryString( $asValue = false ) {
20 42
		return $asValue ? '+' : '';
21
	}
22
23 1
	public function isSingleton() {
24 1
		return false;
25
	}
26
27 29
	public function getSize() {
28 29
		return 0; // no real condition, no size or depth
29
	}
30
31 60
	public function prune( &$maxsize, &$maxdepth, &$log ) {
32 60
		return $this;
33
	}
34
35
	/**
36
	 * @see Description::getFingerprint
37
	 * @since 2.5
38
	 *
39
	 * @return string
40
	 */
41 51
	public function getFingerprint() {
42
		// Avoid a simple 0 which may interfere with an associative array
43
		// when compounding hash strings from different descriptions
44 51
		return 'T:' . md5( 0 );
45
	}
46
47
}
48