Passed
Push — master ( 9459b2...59d671 )
by Alexandros
01:52
created

NullableTrait::setCanBeNull()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
namespace MisterIcy\ExcelWriter\Properties\Traits;
5
6
/**
7
 * Trait NullableTrait
8
 * @package MisterIcy\ExcelWriter\Properties\Traits
9
 */
10
trait NullableTrait
11
{
12
    /**
13
     * @var bool
14
     */
15
    protected $strict = false;
16
17
    /**
18
     * @var bool
19
     */
20
    protected $canBeNull = true;
21
22
    /**
23
     * @return bool
24
     */
25
    public function isStrict(): bool
26
    {
27
        return $this->strict;
28
    }
29
30
    /**
31
     * @param bool $strict
32
     * @return self
33
     */
34
    public function setStrict(bool $strict): self
35
    {
36
        $this->strict = $strict;
37
        return $this;
38
    }
39
40
    /**
41
     * @return bool
42
     */
43
    public function isCanBeNull(): bool
44
    {
45
        return $this->canBeNull;
46
    }
47
48
    /**
49
     * @param bool $canBeNull
50
     * @return self
51
     */
52
    public function setCanBeNull(bool $canBeNull): self
53
    {
54
        $this->canBeNull = $canBeNull;
55
        return $this;
56
    }
57
58
59
}