Test Failed
Push — develop ( 32ca41...230235 )
by Brent
04:59
created

AbstractVariable   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
dl 0
loc 32
ccs 6
cts 9
cp 0.6667
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
parse() 0 1 ?
A __construct() 0 4 1
A getUnparsed() 0 4 1
A getParsed() 0 8 2
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