@@ -72,27 +72,27 @@ public function isInitialized(PropertyReflection $property, string $propertyName
7272 */
7373 private function isGedmoAnnotationOrAttribute (PropertyReflection $ property , string $ propertyName , array $ classList ): bool
7474 {
75- if ($ this ->annotationReader === null ) {
76- return false ;
77- }
78-
7975 $ classReflection = $ property ->getDeclaringClass ();
8076 if ($ this ->objectMetadataResolver ->isTransient ($ classReflection ->getName ())) {
8177 return false ;
8278 }
8379
8480 $ propertyReflection = $ classReflection ->getNativeReflection ()->getProperty ($ propertyName );
8581
86- $ annotations = $ this -> annotationReader -> getPropertyAnnotations ( $ propertyReflection );
87- foreach ($ annotations as $ annotation ) {
88- if (in_array (get_class ( $ annotation ), $ classList , true )) {
82+ $ attributes = $ propertyReflection -> getAttributes ( );
83+ foreach ($ attributes as $ attribute ) {
84+ if (in_array ($ attribute -> getName ( ), $ classList , true )) {
8985 return true ;
9086 }
9187 }
9288
93- $ attributes = $ propertyReflection ->getAttributes ();
94- foreach ($ attributes as $ attribute ) {
95- if (in_array ($ attribute ->getName (), $ classList , true )) {
89+ if ($ this ->annotationReader === null ) {
90+ return false ;
91+ }
92+
93+ $ annotations = $ this ->annotationReader ->getPropertyAnnotations ($ propertyReflection );
94+ foreach ($ annotations as $ annotation ) {
95+ if (in_array (get_class ($ annotation ), $ classList , true )) {
9696 return true ;
9797 }
9898 }
0 commit comments