Completed
Pull Request — master (#5)
by
unknown
02:59
created

FunctionValue::initializeFromOldFormat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 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
	private $name, $args;
0 ignored issues
show
Coding Style introduced by
It is generally advisable to only define one property per statement.

Only declaring a single property per statement allows you to later on add doc comments more easily.

It is also recommended by PSR2, so it is a common style that many people expect.

Loading history...
21
22
	/**
23
	 * @inheritdoc
24
	 */
25 11
	public function getCompiled()
26
	{
27 11
		return $this->name.'('.$this->compiler->compileValue($this->args).')';
28
	}
29
30
	/**
31
	 * @inheritdoc
32
	 */
33 11
	public function initializeFromOldFormat(array $value)
34
	{
35 11
		$this->name = $value[1];
36 11
		$this->args = $value[2];
37
	}
38
}