SerializerFactory   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 8

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 8
dl 0
loc 55
ccs 10
cts 20
cp 0.5
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A newSimpleItemSerializer() 0 6 1
A newSimplePropertySerializer() 0 5 1
A newStableItemSerializer() 0 7 1
A newPropertyListSerializer() 0 3 1
A newItemListSerializer() 0 3 1
A newItemTypeSerializer() 0 3 1
1
<?php
2
3
namespace Queryr\Serialization;
4
5
use Serializers\Serializer;
6
7
/**
8
 * @access public
9
 * @licence GNU GPL v2+
10
 * @author Jeroen De Dauw < [email protected] >
11
 */
12
class SerializerFactory {
13
14
	/**
15
	 * @return Serializer
16
	 */
17 1
	public function newSimpleItemSerializer() {
18 1
		return new SimpleItemSerializer(
19 1
			new SimpleFoundationSerializer(),
20 1
			new SimpleStatementSerializer()
21 1
		);
22
	}
23
24
	/**
25
	 * @return Serializer
26
	 */
27
	public function newSimplePropertySerializer() {
28
		return new SimplePropertySerializer(
29
			new SimpleFoundationSerializer()
30
		);
31
	}
32
33
	/**
34
	 * @param string[] $propertyMap Maps property id (string) to stable property name
35
	 * @return Serializer
36
	 */
37 1
	public function newStableItemSerializer( array $propertyMap ) {
38 1
		return new StableItemSerializer(
39 1
			new SimpleFoundationSerializer(),
40 1
			new SimpleStatementSerializer(),
41
			$propertyMap
42 1
		);
43
	}
44
45
	/**
46
	 * @return Serializer
47
	 */
48
	public function newPropertyListSerializer() {
49
		return new PropertyListSerializer();
50
	}
51
52
	/**
53
	 * @return Serializer
54
	 */
55
	public function newItemListSerializer() {
56
		return new ItemListSerializer();
57
	}
58
59
	/**
60
	 * @return Serializer
61
	 */
62
	public function newItemTypeSerializer() {
63
		return new ItemTypeSerializer();
64
	}
65
66
}
67