NumberASTNode::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
nc 1
cc 1
eloc 2
nop 0
crap 1
1
<?php
2
3
namespace Vlaswinkel\Lua\AST;
4
5
/**
6
 * Class NumberASTNode
7
 *
8
 * @author  Koen Vlaswinkel <[email protected]>
9
 * @package Vlaswinkel\Lua\AST
10
 */
11
class NumberASTNode extends LiteralASTNode {
12
    const NAME = 'number';
13
14
    /**
15
     * @var integer|float
16
     */
17
    private $value;
18
19
    /**
20
     * NumberASTNode constructor.
21
     *
22
     * @param float|int $value
23
     */
24 8
    public function __construct($value) {
25 8
        $this->value = $value;
26 8
    }
27
28
    /**
29
     * @return string
30
     */
31 2
    public function getName() {
32 2
        return self::NAME;
33
    }
34
35
    /**
36
     * @return float|int
37
     */
38 5
    public function getValue() {
39 5
        return $this->value;
40
    }
41
}