Test Setup Failed
Pull Request — master (#198)
by Jeroen De
09:22
created

FakeEntityDocument::clear()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Wikibase\DataModel\Services\Fixtures;
4
5
use Wikibase\DataModel\Entity\EntityDocument;
6
use Wikibase\DataModel\Entity\EntityId;
7
8
/**
9
 * @license GPL-2.0+
10
 * @author Jeroen De Dauw < [email protected] >
11
 */
12
class FakeEntityDocument implements EntityDocument {
13
14
	/**
15
	 * @var EntityId
16
	 */
17
	private $id;
18
19
	public function __construct( EntityId $id ) {
20
		$this->id = $id;
21
	}
22
23
	/**
24
	 * @return EntityId
25
	 */
26
	public function getId() {
27
		return $this->id;
28
	}
29
30
	/**
31
	 * @return string Returns the entity type of the provided EntityId.
32
	 */
33
	public function getType() {
34
		return $this->id->getEntityType();
35
	}
36
37
	/**
38
	 * @param EntityId $id
39
	 */
40
	public function setId( $id ) {
41
		$this->id = $id;
42
	}
43
44
	/**
45
	 * @return bool
46
	 */
47
	public function isEmpty() {
48
		return true;
49
	}
50
51
	/**
52
	 * @see EntityDocument::equals
53
	 *
54
	 * @param mixed $target
55
	 *
56
	 * @return bool Always true.
57
	 */
58
	public function equals( $target ) {
59
		return true;
60
	}
61
62
	/**
63
	 * @see EntityDocument::copy
64
	 *
65
	 * @return self
66
	 */
67
	public function copy() {
68
		return new self( $this->id );
69
	}
70
71
	/**
72
	 * @see EntityDocument::clear
73
	 */
74
	public function clear() {
75
	}
76
77
}
78