diff --git a/Metadata/MetadataConverter.php b/Metadata/MetadataConverter.php index cb67ca7..9c03d70 100644 --- a/Metadata/MetadataConverter.php +++ b/Metadata/MetadataConverter.php @@ -69,11 +69,7 @@ public function convert(ClassHierarchyMetadata $metadata) } if ($classMetadata->initMethod) { - if (!method_exists($definition, 'setInitMethod')) { - throw new \RuntimeException(sprintf('@AfterSetup is not available on your Symfony version.')); - } - - $definition->setInitMethod($classMetadata->initMethod); + throw new \RuntimeException(sprintf('You can\'t use @AfterSetup on a service.')); } $definitions[$classMetadata->id] = $definition;