BaseValueParser   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 26
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getRaw() 0 3 1
A setRaw() 0 3 1
A from() 0 5 1
1
<?php
2
/**
3
 * @author Aleksandar Panic
4
 * @license http://www.apache.org/licenses/LICENSE-2.0
5
 * @since 1.0.0
6
 **/
7
8
namespace ArekX\ArrayExpression\ValueParsers;
9
10
11
use ArekX\ArrayExpression\Interfaces\ValueParser;
12
13
/**
14
 * Class BaseValueParser
15
 * Base value parser which is used to handle common functionality.
16
 *
17
 * @package ArekX\ArrayExpression\ValueParsers
18
 *
19
 */
20
abstract class BaseValueParser implements ValueParser
21
{
22
    protected $raw;
23
24
    /**
25
     * @inheritDoc
26
     */
27 52
    public function setRaw($rawValue)
28
    {
29 52
        $this->raw = $rawValue;
30 52
    }
31
32
    /**
33
     * @inheritDoc
34
     */
35 4
    public function getRaw()
36
    {
37 4
        return $this->raw;
38
    }
39
40
41 31
    public static function from($rawValue)
42
    {
43 31
        $valueParser = new static();
44 31
        $valueParser->setRaw($rawValue);
45 31
        return $valueParser;
46
    }
47
}