File tree Expand file tree Collapse file tree
src/JMS/Serializer/Metadata/Driver
tests/JMS/Serializer/Tests/Fixtures Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,10 +214,10 @@ public function loadMetadataForClass(\ReflectionClass $class)
214214 }
215215 }
216216
217- $ propertyMetadata ->setAccessor ($ accessType , $ accessor [0 ], $ accessor [1 ]);
218217
219218 if ((ExclusionPolicy::NONE === $ exclusionPolicy && ! $ isExclude )
220219 || (ExclusionPolicy::ALL === $ exclusionPolicy && $ isExpose )) {
220+ $ propertyMetadata ->setAccessor ($ accessType , $ accessor [0 ], $ accessor [1 ]);
221221 $ classMetadata ->addPropertyMetadata ($ propertyMetadata );
222222 }
223223 }
Original file line number Diff line number Diff line change 1919namespace JMS \Serializer \Tests \Fixtures ;
2020
2121use JMS \Serializer \Annotation \AccessType ;
22+ use JMS \Serializer \Annotation \Exclude ;
2223use JMS \Serializer \Annotation \Type ;
2324use JMS \Serializer \Annotation \ReadOnly ;
2425
@@ -36,6 +37,12 @@ class GetSetObject
3637 */
3738 private $ readOnlyProperty = 42 ;
3839
40+ /**
41+ * This property should be exlcluded
42+ * @Exclude()
43+ */
44+ private $ excludedProperty ;
45+
3946 public function getId ()
4047 {
4148 throw new \RuntimeException ('This should not be called. ' );
You can’t perform that action at this time.
0 commit comments