1 | <?php |
||
21 | final class Property |
||
22 | { |
||
23 | /** |
||
24 | * The actual name of the property |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | private $realName; |
||
29 | |||
30 | /** |
||
31 | * The serialized version of the property name |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | private $serializedName; |
||
36 | |||
37 | /** |
||
38 | * The property type |
||
39 | * |
||
40 | * @var PhpType |
||
41 | */ |
||
42 | private $type; |
||
43 | |||
44 | /** |
||
45 | * The method for getting values from this property |
||
46 | * |
||
47 | * @var GetterStrategy |
||
48 | */ |
||
49 | private $getterStrategy; |
||
50 | |||
51 | /** |
||
52 | * The method for setting values to this property |
||
53 | * |
||
54 | * @var SetterStrategy |
||
55 | */ |
||
56 | private $setterStrategy; |
||
57 | |||
58 | /** |
||
59 | * A set of annotations |
||
60 | * |
||
61 | * @var AnnotationSet |
||
62 | */ |
||
63 | private $annotations; |
||
64 | |||
65 | /** |
||
66 | * An integer that represents what modifiers are associated with the property |
||
67 | * |
||
68 | * These constants are defined in [@see \ReflectionProperty] |
||
69 | * |
||
70 | * @var int |
||
71 | */ |
||
72 | private $modifiers; |
||
73 | |||
74 | /** |
||
75 | * True if the property should be skipped during serialization |
||
76 | * |
||
77 | * @var bool |
||
78 | */ |
||
79 | private $skipSerialize = false; |
||
80 | |||
81 | /** |
||
82 | * True if the property should be skipped during deserialization |
||
83 | * |
||
84 | * @var bool |
||
85 | */ |
||
86 | private $skipDeserialize = false; |
||
87 | |||
88 | /** |
||
89 | * If the property is a virtual property |
||
90 | * @var bool |
||
91 | */ |
||
92 | private $virtual; |
||
93 | |||
94 | /** |
||
95 | * Constructor |
||
96 | * |
||
97 | * @param string $realName |
||
98 | * @param string $serializedName |
||
99 | * @param PhpType $type |
||
100 | * @param GetterStrategy $getterStrategy |
||
101 | * @param SetterStrategy $setterStrategy |
||
102 | * @param AnnotationSet $annotations |
||
103 | * @param int $modifiers |
||
104 | * @param bool $virtual |
||
105 | */ |
||
106 | 8 | public function __construct( |
|
126 | |||
127 | /** |
||
128 | * Get the real name of the property |
||
129 | * |
||
130 | * @return string |
||
131 | */ |
||
132 | 1 | public function getRealName(): string |
|
136 | |||
137 | /** |
||
138 | * Get the serialized name of the property |
||
139 | * |
||
140 | * @return string |
||
141 | */ |
||
142 | 1 | public function getSerializedName(): string |
|
146 | |||
147 | /** |
||
148 | * Get the property type |
||
149 | * |
||
150 | * @return PhpType |
||
151 | */ |
||
152 | 1 | public function getType(): PhpType |
|
156 | |||
157 | /** |
||
158 | * Return the collection of annotations |
||
159 | * |
||
160 | * @return AnnotationSet |
||
161 | */ |
||
162 | 1 | public function getAnnotations(): AnnotationSet |
|
166 | |||
167 | /** |
||
168 | * The property modifiers |
||
169 | * |
||
170 | * @return int |
||
171 | */ |
||
172 | 1 | public function getModifiers(): int |
|
176 | |||
177 | /** |
||
178 | * Returns true if the property is virtual |
||
179 | * |
||
180 | * @return bool |
||
181 | */ |
||
182 | 1 | public function isVirtual(): bool |
|
186 | |||
187 | /** |
||
188 | * Returns should if we should skip during serialization |
||
189 | * |
||
190 | * @return bool |
||
191 | */ |
||
192 | 2 | public function skipSerialize(): bool |
|
196 | |||
197 | /** |
||
198 | * Set whether we should skip during serialization |
||
199 | * |
||
200 | * @param bool $skipSerialize |
||
201 | */ |
||
202 | 1 | public function setSkipSerialize(bool $skipSerialize): void |
|
206 | |||
207 | /** |
||
208 | * Returns should if we should skip during deserialization |
||
209 | * |
||
210 | * @return bool |
||
211 | */ |
||
212 | 2 | public function skipDeserialize(): bool |
|
216 | |||
217 | /** |
||
218 | * Set whether we should skip during deserialization |
||
219 | * |
||
220 | * @param bool $skipDeserialize |
||
221 | */ |
||
222 | 1 | public function setSkipDeserialize(bool $skipDeserialize): void |
|
226 | |||
227 | /** |
||
228 | * Given an object, get the value at this property |
||
229 | * |
||
230 | * @param object $object |
||
231 | * @return mixed |
||
232 | */ |
||
233 | 6 | public function get($object) |
|
237 | |||
238 | /** |
||
239 | * Given an object an value, set the value to the object at this property |
||
240 | * |
||
241 | * @param object $object |
||
242 | * @param mixed $value |
||
243 | */ |
||
244 | 6 | public function set($object, $value): void |
|
252 | } |
||
253 |