JsonLdResourceNodeDeserializer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 12
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getDeserialization() 0 5 1
1
<?php
2
3
namespace PPP\DataModel\Deserializers;
4
5
use PPP\DataModel\JsonLdResourceNode;
6
7
/**
8
 * @licence AGPLv3+
9
 * @author Thomas Pellissier Tanon
10
 */
11
class JsonLdResourceNodeDeserializer extends AbstractResourceNodeDeserializer {
12
13 9
	public function __construct() {
14 9
		parent::__construct('resource-jsonld');
15 9
	}
16
17 1
	protected function getDeserialization($value, array $serialization) {
18 1
		$this->requireAttribute($serialization, 'graph');
19
20 1
		return new JsonLdResourceNode($value, json_decode(json_encode($serialization['graph'])));
21
	}
22
}
23