Passed
Push — develop ( 37d230...30ebd1 )
by Brent
03:14
created

AbstractVariable::parsed()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 8
ccs 4
cts 4
cp 1
crap 2
rs 9.4285
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 = null;
9
10
    public abstract function parse(): AbstractVariable;
0 ignored issues
show
Coding Style introduced by
The abstract declaration must precede the visibility declaration
Loading history...
11
12 34
    public function __construct($unparsed)
13
    {
14 34
        $this->unparsed = $unparsed;
15 34
    }
16
17
    /**
18
     * @return mixed
19
     */
20
    public function getUnparsed()
21
    {
22
        return $this->unparsed;
23
    }
24
25
    /**
26
     * @return mixed
27
     */
28 33
    public function getParsed()
29
    {
30 33
        if (! $this->parsed) {
31 29
            $this->parse();
32
        }
33
34 33
        return $this->parsed;
35
    }
36
}
37