PropertyDefinition   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 1
dl 0
loc 79
rs 10
c 0
b 0
f 0
ccs 18
cts 18
cp 1

7 Methods

Rating   Name   Duplication   Size   Complexity  
A defineDependency() 0 6 1
A getPropertyName() 0 4 1
A setPropertyName() 0 6 1
A getModifiers() 0 4 1
A setModifiers() 0 6 1
A isPublic() 0 4 1
A setIsPublic() 0 6 1
1
<?php declare(strict_types = 1);
2
/**
3
 * Created by PhpStorm.
4
 * User: root
5
 * Date: 02.08.16
6
 * Time: 0:46.
7
 */
8
namespace samsonframework\container\definition;
9
10
use samsonframework\container\definition\reference\ReferenceInterface;
11
12
/**
13
 * Class PropertyDefinition
14
 *
15
 * @package samsonframework\container\definition
16
 */
17
class PropertyDefinition extends AbstractPropertyDefinition implements PropertyBuilderInterface
18
{
19
    /** @var string Property name */
20
    protected $propertyName;
21
    /** @var bool Flag that property is public */
22
    public $isPublic = false;
23
    /** @var int Property modifiers */
24
    public $modifiers = 0;
25
26
    /**
27
     * Define dependency
28
     *
29
     * @param ReferenceInterface $dependency
30
     * @return PropertyBuilderInterface
31
     */
32 8
    public function defineDependency(ReferenceInterface $dependency): PropertyBuilderInterface
33
    {
34 8
        $this->dependency = $dependency;
35
36 8
        return $this;
37
    }
38
39
    /**
40
     * @return string
41
     */
42 2
    public function getPropertyName(): string
43
    {
44 2
        return $this->propertyName;
45
    }
46
47
    /**
48
     * @param string $propertyName
49
     * @return PropertyDefinition
50
     */
51 10
    public function setPropertyName(string $propertyName): PropertyDefinition
52
    {
53 10
        $this->propertyName = $propertyName;
54
55 10
        return $this;
56
    }
57
58
    /**
59
     * @return int
60
     */
61 2
    public function getModifiers(): int
62
    {
63 2
        return $this->modifiers;
64
    }
65
66
    /**
67
     * @param int $modifiers
68
     * @return PropertyDefinition
69
     */
70 3
    public function setModifiers(int $modifiers): PropertyDefinition
71
    {
72 3
        $this->modifiers = $modifiers;
73
74 3
        return $this;
75
    }
76
77
    /**
78
     * @return boolean
79
     */
80 3
    public function isPublic(): bool
81
    {
82 3
        return $this->isPublic;
83
    }
84
85
    /**
86
     * @param boolean $isPublic
87
     * @return PropertyDefinition
88
     */
89 3
    public function setIsPublic(bool $isPublic): PropertyDefinition
90
    {
91 3
        $this->isPublic = $isPublic;
92
93 3
        return $this;
94
    }
95
}
96