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