Passed
Push — rankClass ( 1b9cf4...7f76c7 )
by no
04:15 queued 16s
created

CustomEntityId   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A serialize() 0 3 1
A unserialize() 0 5 1
A getEntityType() 0 3 1
1
<?php
2
3
namespace Wikibase\DataModel\Fixtures;
4
5
use Wikibase\DataModel\Entity\EntityId;
6
7
/**
8
 * Dummy custom EntityId implementation for use with EntityIdValueTest
9
 *
10
 * @license GPL 2+
11
 * @author Daniel Kinzler
12
 */
13
class CustomEntityId extends EntityId {
14
15
	/**
16
	 * @see Serializable::serialize
17
	 *
18
	 * @return string
19
	 */
20
	public function serialize() {
21
		return $this->serialization;
22
	}
23
24
	/**
25
	 * @see Serializable::unserialize
26
	 *
27
	 * @param string $serialized
28
	 */
29
	public function unserialize( $serialized ) {
30
		$this->serialization = $serialized;
31
		$this->repositoryName = '';
32
		$this->localPart = $serialized;
33
	}
34
35
	/**
36
	 * @return string
37
	 */
38
	public function getEntityType() {
39
		return 'custom';
40
	}
41
42
}
43