Completed
Push — master ( e41e91...2b4213 )
by Aleh
01:47 queued 01:39
created

MethodData::isProtected()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Padawan\Domain\Project\Node;
4
5
use Padawan\Domain\Project\FQCN;
6
7
class MethodData extends FunctionData
8
{
9
    public $name        = "";
10
    public $arguments   = [];
11
    public $doc         = "";
12
    public $type        = 0;
13
    public $startLine   = 0;
14
    public $endLine     = 0;
15
    public $return      = null;
16
17
    public function isPublic()
18
    {
19
        return (bool) ($this->type & ClassData::MODIFIER_PUBLIC);
20
    }
21
22
    public function isProtected()
23
    {
24
        return (bool) ($this->type & ClassData::MODIFIER_PROTECTED);
25
    }
26
27
    public function isPrivate()
28
    {
29
        return (bool) ($this->type & ClassData::MODIFIER_PRIVATE);
30
    }
31
32
    public function isAbstract()
33
    {
34
        return (bool) ($this->type & ClassData::MODIFIER_ABSTRACT);
35
    }
36
37
    public function isFinal()
38
    {
39
        return (bool) ($this->type & ClassData::MODIFIER_FINAL);
40
    }
41
42
    public function isStatic()
43
    {
44
        return (bool) ($this->type & ClassData::MODIFIER_STATIC);
45
    }
46
    public function isMagic()
47
    {
48
        return in_array($this->name, [
49
            '__construct',
50
            '__destruct',
51
            '__get',
52
            '__set',
53
            '__isset',
54
            '__unset',
55
            '__toString',
56
            '__call',
57
            '__clone'
58
        ]);
59
    }
60
    public function setType($type)
61
    {
62
        $this->type = $type;
63
    }
64
}
65