MonolingualTextParser::stringParse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace PPP\Wikidata\ValueParsers;
4
5
use DataValues\MonolingualTextValue;
6
use ValueParsers\StringValueParser;
7
use ValueParsers\ValueParser;
8
9
/**
10
 * Parse string value.
11
 *
12
 * @licence AGPLv3+
13
 * @author Thomas Pellissier Tanon
14
 */
15
class MonolingualTextParser extends StringValueParser {
16
17
	const FORMAT_NAME = 'monolingualtext';
18
19 1
	protected function stringParse($value) {
20 1
		return new MonolingualTextValue($this->getOption(ValueParser::OPT_LANG), $value);
21
	}
22
}
23