SerializerFactory::newItemTypeSerializer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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