diff --git a/src/Metadata/Driver/XmlDriver.php b/src/Metadata/Driver/XmlDriver.php index 9eecf5502..e0238f504 100644 --- a/src/Metadata/Driver/XmlDriver.php +++ b/src/Metadata/Driver/XmlDriver.php @@ -363,15 +363,15 @@ protected function loadMetadataFromFile(\ReflectionClass $class, string $path): switch ((string) $method->attributes()->type) { case 'pre-serialize': - $metadata->addPreSerializeMethod(new MethodMetadata($name, (string) $method->attributes()->name)); + $metadata->addPreSerializeMethod(new MethodMetadata($class->name, (string) $method->attributes()->name)); break; case 'post-serialize': - $metadata->addPostSerializeMethod(new MethodMetadata($name, (string) $method->attributes()->name)); + $metadata->addPostSerializeMethod(new MethodMetadata($class->name, (string) $method->attributes()->name)); break; case 'post-deserialize': - $metadata->addPostDeserializeMethod(new MethodMetadata($name, (string) $method->attributes()->name)); + $metadata->addPostDeserializeMethod(new MethodMetadata($class->name, (string) $method->attributes()->name)); break; case 'handler':