Passed
Push — master ( b28623...b691b7 )
by Sebastian
04:23
created

Value_Bool_False::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
/**
3
 * File containing the {@see AppUtils\Value_Bool_False} class.
4
 *
5
 * @package Application Utils
6
 * @subpackage Values
7
 * @see AppUtils\Value_Bool_False
8
 */
9
10
declare(strict_types=1);
11
12
namespace AppUtils;
13
14
/**
15
 * Sticky false-based boolean value: starts out as true,
16
 * and if it is set to false, cannot be set to true again
17
 * afterwards.
18
 *
19
 * @package Application Utils
20
 * @subpackage Values
21
 * @author Sebastian Mordziol <[email protected]>
22
 */
23
class Value_Bool_False extends Value_Bool
24
{
25
    public function __construct(bool $value=true)
26
    {
27
        parent::__construct($value);
28
    }
29
    
30
    public function set(bool $value) : Value_Bool
31
    {
32
        if($value === false)
33
        {
34
            parent::set($value);
35
        }
36
        
37
        return $this;
38
    }
39
}
40