Property::getDoc()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Created by gerk on 22.09.16 17:03
4
 */
5
6
namespace PeekAndPoke\Component\MetaCore\DomainModel;
7
8
use PeekAndPoke\Component\Slumber\Annotation\Slumber;
9
10
/**
11
 * @author Karsten J. Gerber <[email protected]>
12
 */
13
class Property
14
{
15
    /**
16
     * @var string
17
     *
18
     * @Slumber\AsString()
19
     */
20
    protected $name;
21
    /**
22
     * @var TypeRef
23
     *
24
     * @Slumber\AsObject(TypeRef::class)
25
     */
26
    protected $typeRef;
27
    /**
28
     * @var Visibility
29
     *
30
     * @Slumber\AsEnum(Visibility::class)
31
     */
32
    protected $visibility;
33
    /**
34
     * @var boolean
35
     *
36
     * @Slumber\AsBool()
37
     */
38
    protected $nullable = false;
39
    /**
40
     * @var Docs\Doc
41
     *
42
     * @Slumber\AsObject(Docs\Doc::class)
43
     */
44
    protected $doc;
45
46
    /**
47
     * @param string     $name
48
     * @param TypeRef    $typeRef
49
     * @param Visibility $visibility
50
     * @param bool       $nullable
51
     * @param Docs\Doc   $doc
52
     */
53 11
    public function __construct($name, TypeRef $typeRef, Visibility $visibility, $nullable, Docs\Doc $doc)
54
    {
55 11
        $this->name       = $name;
56 11
        $this->typeRef    = $typeRef;
57 11
        $this->visibility = $visibility;
58 11
        $this->nullable   = $nullable;
59 11
        $this->doc        = $doc;
60 11
    }
61
62
    /**
63
     * @return string
64
     */
65 27
    public function getName()
66
    {
67 27
        return $this->name;
68
    }
69
70
    /**
71
     * @return TypeRef
72
     */
73 21
    public function getTypeRef()
74
    {
75 21
        return $this->typeRef;
76
    }
77
78
    /**
79
     * @return Visibility
80
     */
81 1
    public function getVisibility()
82
    {
83 1
        return $this->visibility;
84
    }
85
86
    /**
87
     * @return bool
88
     */
89 17
    public function isNullable()
90
    {
91 17
        return $this->nullable;
92
    }
93
94
    /**
95
     * @return Docs\Doc
96
     */
97 3
    public function getDoc()
98
    {
99 3
        return $this->doc;
100
    }
101
}
102