Completed
Push — master ( 6ece6a...9c4912 )
by Marcus
02:53
created

FunctionValue   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 29
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCompiled() 0 4 1
A initializeFromOldFormat() 0 5 1
1
<?php
2
namespace LesserPhp\Compiler\Value;
3
4
/**
5
 * lesserphp
6
 * https://www.maswaba.de/lesserphp
7
 *
8
 * LESS CSS compiler, adapted from http://lesscss.org
9
 *
10
 * Copyright 2013, Leaf Corcoran <[email protected]>
11
 * Copyright 2016, Marcus Schwarz <[email protected]>
12
 * Copyright 2017, Stefan Pöhner <[email protected]>
13
 * Licensed under MIT or GPLv3, see LICENSE
14
 *
15
 * @package LesserPhp
16
 */
17
18
class FunctionValue extends AbstractValue
19
{
20
    /**
21
     * @var string
22
     */
23
    private $name;
24
25
    /**
26
     * @var array
27
     */
28
    private $args;
29
30
    /**
31
     * @inheritdoc
32
     */
33 11
    public function getCompiled()
34
    {
35 11
        return $this->name . '(' . $this->compiler->compileValue($this->args) . ')';
36
    }
37
38
    /**
39
     * @inheritdoc
40
     */
41 11
    public function initializeFromOldFormat(array $value)
42
    {
43 11
        $this->name = $value[1];
44 11
        $this->args = $value[2];
45 11
    }
46
}
47