@@ -72,27 +72,27 @@ public function isInitialized(PropertyReflection $property, string $propertyName
72
72
*/
73
73
private function isGedmoAnnotationOrAttribute (PropertyReflection $ property , string $ propertyName , array $ classList ): bool
74
74
{
75
- if ($ this ->annotationReader === null ) {
76
- return false ;
77
- }
78
-
79
75
$ classReflection = $ property ->getDeclaringClass ();
80
76
if ($ this ->objectMetadataResolver ->isTransient ($ classReflection ->getName ())) {
81
77
return false ;
82
78
}
83
79
84
80
$ propertyReflection = $ classReflection ->getNativeReflection ()->getProperty ($ propertyName );
85
81
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 )) {
89
85
return true ;
90
86
}
91
87
}
92
88
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 )) {
96
96
return true ;
97
97
}
98
98
}
0 commit comments