ReflectionProperty   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 77
ccs 0
cts 2
cp 0
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isProperty() 0 4 1
1
<?php
2
/**
3
 * This file is part of the Composite Utils package.
4
 *
5
 * (c) Emily Shepherd <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the
8
 * LICENSE.md file that was distributed with this source code.
9
 *
10
 * @package spaark/composite-utils
11
 * @author Emily Shepherd <[email protected]>
12
 * @license MIT
13
 */
14
15
namespace Spaark\CompositeUtils\Model\Reflection;
16
17
use Spaark\CompositeUtils\Model\Reflection\Type\AbstractType;
18
19
/**
20
 * Represents a property within a composite
21
 *
22
 * @property-read string $name
23
 * @property-read ReflectionComposite $owner
24
 * @property-read boolean $readable
25
 * @property-read boolean $writable
26
 * @property-read AbstractType $type
27
 * @property-read mixed $defaultValue
28
 * @property-read boolean $passedToConstructor
29
 * @property-read boolean $requiredInConstructor
30
 * @property-read boolean $builtInConstructor
31
 */
32
class ReflectionProperty extends Reflector
33
{
34
    /**
35
     * The name of this property
36
     *
37
     * @var string
38
     */
39
    protected $name;
40
41
    /**
42
     * The Composite that this property belongs to
43
     *
44
     * @var ReflectionComposite
45
     */
46
    protected $owner;
47
48
    /**
49
     * Is this property readable?
50
     *
51
     * @var bool
52
     * @readable
53
     */
54
    protected $readable = false;
55
56
    /**
57
     * Is this property writable?
58
     *
59
     * @var bool
60
     * @readable
61
     */
62
    protected $writable = false;
63
64
    /**
65
     * This property's type
66
     *
67
     * @var AbstractType
68
     * @readable
69
     */
70
    protected $type;
71
72
    /**
73
     * This property's default value
74
     *
75
     * @readable
76
     * @var mixed
77
     */
78
    protected $defaultValue;
79
80
    /**
81
     * Is this property passed to the constructor
82
     *
83
     * @var boolean
84
     */
85
    protected $passedToConstructor;
86
87
    /**
88
     * Is this property required by the constructor
89
     *
90
     * @var boolean
91
     */
92
    protected $requiredInConstructor;
93
94
    /**
95
     * Is this property built in the constructor
96
     *
97
     * @var boolean
98
     */
99
    protected $builtInConstructor;
100
101
    /**
102
     * @getter
103
     */
104
    public function isProperty()
105
    {
106
        return (boolean)$this->type;
107
    }
108
}
109