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

MethodData   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
c 1
b 0
f 0
lcom 2
cbo 1
dl 0
loc 58
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A isPublic() 0 4 1
A isProtected() 0 4 1
A isPrivate() 0 4 1
A isAbstract() 0 4 1
A isFinal() 0 4 1
A isStatic() 0 4 1
A isMagic() 0 14 1
A setType() 0 4 1
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