OptNode::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
ccs 0
cts 7
cp 0
rs 9.4285
cc 2
eloc 4
nc 2
nop 2
crap 6
1
<?php
2
/**
3
 * For licensing information, please see the LICENSE file accompanied with this file.
4
 *
5
 * @author Gerard van Helden <[email protected]>
6
 * @copyright 2012 Gerard van Helden <http://melp.nl>
7
 */
8
9
namespace Zicht\Tool\Script\Node\Task;
10
11
use Zicht\Tool\Util;
12
use Zicht\Tool\Script\Node\Expr\Literal;
13
14
/**
15
 * A node for the "args" section of a task
16
 */
17
class OptNode extends ArgNode
18
{
19
    /**
20
     * Constructor.
21
     *
22
     * @param string $name
23
     * @param \Zicht\Tool\Script\Node\Node $expr
24
     */
25
    public function __construct($name, $expr)
26
    {
27
        if (!$expr) {
28
            $expr = new Literal("");
29
        }
30
        parent::__construct($name, $expr, true);
31
    }
32
}
33