StringResourceNodeDeserializer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
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 2
1
<?php
2
3
namespace PPP\DataModel\Deserializers;
4
5
use PPP\DataModel\StringResourceNode;
6
7
/**
8
 * @licence AGPLv3+
9
 * @author Thomas Pellissier Tanon
10
 */
11
class StringResourceNodeDeserializer extends AbstractResourceNodeDeserializer {
12
13 10
	public function __construct() {
14 10
		parent::__construct('string');
15 10
	}
16
17 2
	protected function getDeserialization($value, array $serialization) {
18 2
		$languageCode = array_key_exists('language', $serialization) ? $serialization['language'] : '';
19
20 2
		return new StringResourceNode($value, $languageCode);
21
	}
22
}
23