From 033f2bd9e1ba9a48400e718b41be012a8ccc0f46 Mon Sep 17 00:00:00 2001 From: Vyacheslav Enis Date: Thu, 16 Jan 2014 17:13:04 +0200 Subject: [PATCH] Fixed processing of cyclic types that points to each other --- ServiceDefinition/Loader/AnnotationClassLoader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ServiceDefinition/Loader/AnnotationClassLoader.php b/ServiceDefinition/Loader/AnnotationClassLoader.php index dcd1500..7cebcd3 100644 --- a/ServiceDefinition/Loader/AnnotationClassLoader.php +++ b/ServiceDefinition/Loader/AnnotationClassLoader.php @@ -154,11 +154,11 @@ private function loadType($phpType) $loaded = $complexTypeResolver->load($phpType); $complexType = new ComplexType($phpType, isset($loaded['alias']) ? $loaded['alias'] : $phpType); + $this->typeRepository->addComplexType($complexType); + foreach ($loaded['properties'] as $name => $property) { $complexType->add($name, $this->loadType($property->getValue()), $property->isNillable()); } - - $this->typeRepository->addComplexType($complexType); } return $phpType;