diff --git a/Metadata/MetadataConverter.php b/Metadata/MetadataConverter.php index 49f89bc..9c82910 100644 --- a/Metadata/MetadataConverter.php +++ b/Metadata/MetadataConverter.php @@ -65,10 +65,10 @@ public function convert(ClassHierarchyMetadata $metadata) $definition->setProperties($classMetadata->properties); if (null !== $classMetadata->lazy) { - if (!method_exists($definition, 'setLazy')) { - throw new \RuntimeException(sprintf('the "lazy" attribute is not available on your Symfony version.')); - } - $definition->setLazy($classMetadata->lazy); + if (!method_exists($definition, 'setLazy')) { + throw new \RuntimeException(sprintf('the "lazy" attribute is not available on your Symfony version.')); + } + $definition->setLazy($classMetadata->lazy); } if (null !== $classMetadata->factoryClass) { $definition->setFactoryClass($classMetadata->factoryClass);