NumberValue   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 3
A getContent() 0 4 1
1
<?php
2
3
namespace PhpHocon\Token\Value;
4
5
class NumberValue implements SimpleValue
6
{
7
    /**
8
     * @var float|int
9
     */
10
    private $value;
11
12
    /**
13
     * @param int|float $value
14
     */
15
    public function __construct($value)
16
    {
17
        if (!is_int($value) && !is_float($value)) {
18
            throw new \UnexpectedValueException('Number values must be numeric');
19
        }
20
21
        $this->value = $value;
22
    }
23
24
    /**
25
     * @return float|int
26
     */
27
    public function getContent()
28
    {
29
        return $this->value;
30
    }
31
}
32