AbstractVariable::getParsed()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 8
ccs 3
cts 4
cp 0.75
crap 2.0625
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Stitcher\Variable;
4
5
abstract class AbstractVariable
6
{
7
    protected $unparsed;
8
    protected $parsed;
9
10
    abstract public function parse(): AbstractVariable;
11
12 3
    public function __construct($unparsed)
13
    {
14 3
        $this->unparsed = $unparsed;
15 3
    }
16
17
    /**
18
     * @return mixed
19
     */
20
    public function getUnparsed()
21
    {
22
        return $this->unparsed;
23
    }
24
25
    /**
26
     * @return mixed
27
     */
28 3
    public function getParsed()
29
    {
30 3
        if (! $this->parsed) {
31
            $this->parse();
32
        }
33
34 3
        return $this->parsed;
35
    }
36
}
37