VisibilityTrait::makeProtected()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 2
1
<?php declare(strict_types=1);
2
3
namespace Igni\Utils\ReflectionApi;
4
5
trait VisibilityTrait
6
{
7
    private $visibility = 'public';
8
9 2
    public function makePrivate(): self
10
    {
11 2
        $this->visibility = 'private';
12
13 2
        return $this;
14
    }
15
16 1
    public function makePublic(): self
17
    {
18 1
        $this->visibility = 'public';
19
20 1
        return $this;
21
    }
22
23
    public function makeProtected(): self
24
    {
25
        $this->visibility = 'protected';
26
27
        return $this;
28
    }
29
30 1
    public function isPrivate(): bool
31
    {
32 1
        return $this->visibility === 'private';
33
    }
34
35 1
    public function isProtected(): bool
36
    {
37 1
        return $this->visibility === 'protected';
38
    }
39
40 1
    public function isPublic(): bool
41
    {
42 1
        return $this->visibility === 'public';
43
    }
44
45 8
    public function getVisibility(): string
46
    {
47 8
        return $this->visibility;
48
    }
49
}
50