ListNode::compile()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 8

Duplication

Lines 12
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 12
loc 12
ccs 0
cts 12
cp 0
rs 9.4285
cc 3
eloc 8
nc 3
nop 1
crap 12
1
<?php
2
/**
3
 * @author Gerard van Helden <[email protected]>
4
 * @copyright Zicht Online <http://zicht.nl>
5
 */
6
namespace Zicht\Tool\Script\Node\Expr;
7
8
use Zicht\Tool\Script\Buffer;
9
use Zicht\Tool\Script\Node\Branch;
10
11
12
/**
13
 * Represents a list (0-indexed numeric key array).
14
 */
15
class ListNode extends Branch
16
{
17
    /**
18
     * @{inheritDoc}
19
     */
20 View Code Duplication
    public function compile(Buffer $buffer)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
    {
22
        $buffer->raw('array(');
23
        $i = 0;
24
        foreach ($this->nodes as $child) {
25
            if ($i++ > 0) {
26
                $buffer->raw(', ');
27
            }
28
            $child->compile($buffer);
29
        }
30
        $buffer->raw(')');
31
    }
32
}
33