BooleanValue::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4286
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace PhpHocon\Token\Value;
4
5
class BooleanValue implements SimpleValue
6
{
7
    /**
8
     * @var bool
9
     */
10
    private $value;
11
12
    /**
13
     * @param bool $value
14
     */
15
    public function __construct($value)
16
    {
17
        if (!is_bool($value)) {
18
            throw new \UnexpectedValueException('Boolean Values must be created with a boolean value');
19
        }
20
21
        $this->value = $value;
22
    }
23
24
    /**
25
     * @return boolean
26
     */
27
    public function getContent()
28
    {
29
        return $this->value;
30
    }
31
}
32