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

ClassProperty::isPublic()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
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 3
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 ClassProperty
8
{
9
    public $name;
10
    public $modifier    = 0;
11
    /** @property FQCN|string $type */
12
    public $type        = "";
13
    public $defauls     = "";
14
    public $doc         = "";
15
16
    public function __construct($name = "", $type = "") {
17
        $this->name = $name;
18
        $this->type = $type;
19
    }
20
21
    public function getType() {
22
        return $this->type;
23
    }
24
25
    public function setType(FQCN $fqcn) {
26
        $this->type = $fqcn;
0 ignored issues
show
Documentation Bug introduced by
It seems like $fqcn of type object<Padawan\Domain\Project\FQCN> is incompatible with the declared type string of property $type.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
27
    }
28
29
    public function isPublic() {
30
        return (bool) ($this->modifier & ClassData::MODIFIER_PUBLIC);
31
    }
32
33
    public function isProtected() {
34
        return (bool) ($this->modifier & ClassData::MODIFIER_PROTECTED);
35
    }
36
37
    public function isPrivate() {
38
        return (bool) ($this->modifier & ClassData::MODIFIER_PRIVATE);
39
    }
40
41
    public function isStatic() {
42
        return (bool) ($this->modifier & ClassData::MODIFIER_STATIC);
43
    }
44
45
    /**
46
     * @param integer $modifier
47
     */
48
    public function setModifier($modifier){
49
        $this->modifier = $modifier;
50
    }
51
}
52