@@ 115-124 (lines=10) @@ | ||
112 | $metadata = new ObjectMetadata($class->name); |
|
113 | ||
114 | $properties = $class->getProperties(); |
|
115 | foreach ($properties as $property) { |
|
116 | if ($property->getDeclaringClass()->name !== $class->name) { |
|
117 | continue; |
|
118 | } |
|
119 | ||
120 | $annotation = $this->reader->getPropertyAnnotation($property, Property::class); |
|
121 | if (null !== $annotation) { |
|
122 | $metadata->addProperty($this->loadPropertyMetadata($annotation, $property)); |
|
123 | } |
|
124 | } |
|
125 | ||
126 | if (null !== $object) { |
|
127 | $this->loadDiscriminatorMetadata($object, $metadata); |
|
@@ 146-157 (lines=12) @@ | ||
143 | $metadata->setAllowEmpty($document->allowEmpty); |
|
144 | ||
145 | $properties = $class->getProperties(); |
|
146 | foreach ($properties as $property) { |
|
147 | if ($property->getDeclaringClass()->name !== $class->name) { |
|
148 | continue; |
|
149 | } |
|
150 | ||
151 | $annotation = $this->reader->getPropertyAnnotation($property, ApiContent::class); |
|
152 | if (null !== $annotation) { |
|
153 | $metadata->setContentMetadata($this->loadPropertyMetadata($annotation, $property)); |
|
154 | ||
155 | break; |
|
156 | } |
|
157 | } |
|
158 | ||
159 | return $metadata; |
|
160 | } |