1 | <?php |
||
5 | class ReflectionProperty extends Reflection |
||
6 | { |
||
7 | use Parts\VisibilityTrait; |
||
8 | use Parts\StaticTrait; |
||
9 | use Parts\DeclaringClassLikeTrait; |
||
10 | use Parts\DocCommentTrait; |
||
11 | |||
12 | protected $defaultType = 'null'; |
||
13 | protected $defaultValue = null; |
||
14 | |||
15 | /** |
||
16 | * Gets the property's default type and value. |
||
17 | * |
||
18 | * @return array Type at index 0 and Value at index 1 |
||
19 | */ |
||
20 | 3 | public function getDefault() |
|
24 | |||
25 | /** |
||
26 | * Gets the property's default type. |
||
27 | * |
||
28 | * @return string |
||
29 | */ |
||
30 | 3 | public function getDefaultType() |
|
34 | |||
35 | /** |
||
36 | * Gets the property's default value. |
||
37 | * |
||
38 | * @return mixed |
||
39 | */ |
||
40 | 21 | public function getDefaultValue() |
|
44 | |||
45 | /** |
||
46 | * Sets the property's default value and type. |
||
47 | * |
||
48 | * @param string $type |
||
49 | * @param mixed $value |
||
50 | */ |
||
51 | 786 | public function setDefault($type, $value) |
|
58 | |||
59 | /** |
||
60 | * Gets the property's value. |
||
61 | * |
||
62 | * @param object $object If the property is non-static an object must be provided to fetch the property from |
||
63 | * |
||
64 | * @throws \ReflectionException If something is received in parameter |
||
65 | * |
||
66 | * @return mixed |
||
67 | */ |
||
68 | public function getValue($object = null) |
||
76 | |||
77 | /** |
||
78 | * Checks whether the property was declared at compile-time or was dynamically declared at run-time. |
||
79 | * |
||
80 | * @return bool If the property was declared at compile-time |
||
81 | */ |
||
82 | public function isDefault() |
||
86 | |||
87 | /** |
||
88 | * Set property accessibility. |
||
89 | * |
||
90 | * @param bool $accessible |
||
91 | * |
||
92 | * @throws \ReflectionException Always... Can't be implemented |
||
93 | * |
||
94 | * @return bool |
||
95 | */ |
||
96 | public function setAccessible($accessible) |
||
100 | |||
101 | /** |
||
102 | * Set property value. |
||
103 | * |
||
104 | * @param mixed $objectOrValue |
||
105 | * @param mixed $value |
||
106 | * |
||
107 | * @throws \ReflectionException Always... Can't be implemented |
||
108 | */ |
||
109 | public function setValue($objectOrValue, $value = null) |
||
113 | } |
||
114 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.